Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌐 Add Chinese translation for Tutorial - Schema Extra Example #2411

Merged
merged 3 commits into from
Dec 3, 2020

Conversation

maoyibo
Copy link
Contributor

@maoyibo maoyibo commented Nov 25, 2020

Chinese translation add tutorial/schema-extra-example

@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #2411 (1dd81fb) into master (cc99e23) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2411   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          240       240           
  Lines         7101      7101           
=========================================
  Hits          7101      7101           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d550738...1dd81fb. Read the comment docs.

@github-actions
Copy link
Contributor

📝 Docs preview for commit ca7874a at: https://5fbdc3ba110c133192ff8c1a--fastapi.netlify.app

Copy link
Contributor

@waynerv waynerv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the whitespace between English and Chinese characters.


## `Field` 的附加参数

在 `Field`, `Path`, `Query`, `Body` 和其他你之后将会看到的工厂函数,你可以为JSON 模式声明额外信息,你也可以通过给工厂函数传递其他的任意参数来给JSON 模式生命额外信息,比如增加 `example`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

生命 -> 声明

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

```

!!! warning
请记住,传递的那些额外参数不会添加任何验证,只会添加注释,用于文档目。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用于文档目。->用于文档的目的

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.


关于 `example` 和 `examples`...

JSON Schema在最近的一个版本中定义了一个字段 <a href="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5" class="external-link" target="_blank">`examples`</a> ,但是 OpenAPI 基于之前的一个旧版JSON Schema,并没有 `examples`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“most recent versions” should not translated to "最近的一个版本中"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.


您可以在JSON模式中定义额外的信息。

一个常见的用例是添加一个将在文档中显示的 `示例`。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whitespace before 实例.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

@tiangolo tiangolo changed the title Chinese translation add tutorial/schema-extra-example 🌐 Add Chinese translation for Tutorial - Schema Extra Example Nov 25, 2020
@tiangolo tiangolo added awaiting-review lang-all Translations lang-zh Chinese translations labels Nov 25, 2020
@github-actions
Copy link
Contributor

📝 Docs preview for commit cfb8185 at: https://5fbeff3fda660a8bd74aa083--fastapi.netlify.app

@waynerv
Copy link
Contributor

waynerv commented Nov 26, 2020

What do you think about the idea of keeping one space between Chinese and English characters(both left and right), since most documents that have been merged so far respect this convention.


## Pydantic `schema_extra`

您可以使用 `Config` 和 `schema_extra` 为Pydantic模型声明一个示例,如<a href="https://pydantic-docs.helpmanual.io/usage/schema/#schema-customization" class="external-link" target="_blank">Pydantic's docs: Schema customization</a>中所述:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pydantic's docs: Schema customization -> Pydantic 文档:Schema customization

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.


您可以在JSON模式中定义额外的信息。

一个常见的用例是添加一个将在文档中显示的`示例`。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems better not to translate text in code blocks, e.g example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

@@ -0,0 +1,58 @@
# 额外的模式 - 例子
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This title is not accurate, for the content below is about extra information in shcema, not extra shcemas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I revised the translation to “模式的额外信息”, What do you think of this?

@maoyibo
Copy link
Contributor Author

maoyibo commented Nov 26, 2020

What do you think about the idea of keeping one space between Chinese and English characters(both left and right), since most documents that have been merged so far respect this convention.

I may not pay special attention to this situation in my previous translation, I will pay attention to it in the future, but I think the most important thing is the accuracy of the translation, the whitespace should not affect the generation and reading of the document. We can work on this in future updates.

@github-actions
Copy link
Contributor

📝 Docs preview for commit 1dd81fb at: https://5fbf1b375ec11ab6171fc93c--fastapi.netlify.app

Copy link
Contributor

@waynerv waynerv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@waynerv
Copy link
Contributor

waynerv commented Nov 26, 2020

What do you think about the idea of keeping one space between Chinese and English characters(both left and right), since most documents that have been merged so far respect this convention.

I may not pay special attention to this situation in my previous translation, I will pay attention to it in the future, but I think the most important thing is the accuracy of the translation, the whitespace should not affect the generation and reading of the document. We can work on this in future updates.

It's OK.

@tiangolo
Copy link
Owner

tiangolo commented Dec 3, 2020

Awesome! Thanks a lot for your contribution @maoyibo ! 🙇 ☕

And thanks @waynerv and @Laineyzhang55 as always for the help and reviews 🍰

@tiangolo tiangolo merged commit 4236c99 into tiangolo:master Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-2 lang-all Translations lang-zh Chinese translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants