-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
🌐 Update Chinese translation for docs/tutorial/security/simple-oauth2.md
#3844
🌐 Update Chinese translation for docs/tutorial/security/simple-oauth2.md
#3844
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #3844 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 540 410 -130
Lines 13969 10281 -3688
===========================================
- Hits 13969 10281 -3688 ☔ View full report in Codecov by Sentry. |
📝 Docs preview for commit a4467b1 at: https://612f2537f71da87cecc1f9f3--fastapi.netlify.app |
docs/tutorial/security/simple-oauth2.md
📝 Docs preview for commit d99b77f at: https://638367c3cb23926ae9f8ad08--fastapi.netlify.app |
…al-security-simple-oauth2.md
📝 Docs preview for commit a864982 at: https://639ce8e42c118d097747f852--fastapi.netlify.app |
…al-security-simple-oauth2.md
📝 Docs preview for commit 62212be at: https://649a1ad41636a413a2534ba0--fastapi.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This PR attempts to polish the sentences to make the chapter more easier to read, and there is no change in meaning.
|
||
不过不用担心,你可以在前端按照你的想法将它展示给最终用户。 | ||
不过也不用担心,前端仍可以显示终端用户所需的名称。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The English text here is:
I guess the original translation is better because here "终端用户所需" introduces a misleading idea that the name displayed is required/specified by the end user (instead of the developer, as the original English text suggests).
|
||
但是对于登录*路径操作*,我们需要使用这些名称来与规范兼容(以具备例如使用集成的 API 文档系统的能力)。 | ||
但对于登录*路径操作*,则要使用兼容规范的 `username` 和 `password`,(例如,实现与 API 文档集成)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a redundant comma. Also, the orginal English says:
So I think the "例如" here is unclear. We need to point out that the example is used to explain the advantage of complying with the specs.
但对于登录*路径操作*,则要使用兼容规范的 `username` 和 `password`,(例如,实现与 API 文档集成)。 | |
但对于登录*路径操作*,则要使用兼容规范的 `username` 和 `password`(以具备诸如使用集成的 API 文档系统这样的能力)。 |
|
||
规范还写明了 `username` 和 `password` 必须作为表单数据发送(因此,此处不能使用 JSON)。 | ||
该规范要求必须以表单数据形式发送 `username` 和 `password`,因此,不能使用 JSON 对象。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The translation of also
is missed and I think some degree of respect for the original text is still needed, so the annotation marks like parenthesis should be reserved.
该规范要求必须以表单数据形式发送 `username` 和 `password`,因此,不能使用 JSON 对象。 | |
该规范还要求必须以表单数据形式发送 `username` 和 `password`(因此不能使用 JSON 对象)。 |
|
||
### `scope` | ||
### `Scope`(作用域) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to keep the same lowercase in a code block, just like the original text.
### `Scope`(作用域) | |
### `scope`(作用域) |
|
||
这个表单字段的名称为 `scope`(单数形式),但实际上它是一个由空格分隔的「作用域」组成的长字符串。 | ||
虽然表单字段的名称是 `scope`(单数),但实际上,它是以空格分隔的,由多个**scope**组成的长字符串。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
虽然表单字段的名称是 `scope`(单数),但实际上,它是以空格分隔的,由多个**scope**组成的长字符串。 | |
虽然表单字段的名称是 `scope`(单数),但实际上,它是由多个「作用域」组成的长字符串,各个作用域之间使用空格分割。 |
* Facebook / Instagram 使用 `instagram_basic`。 | ||
* Google 使用了 `https://www.googleapis.com/auth/drive` 。 | ||
* 常见用例为,`users:read` 或 `users:write` | ||
* 脸书和 Instagram 使用 `instagram_basic` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 脸书和 Instagram 使用 `instagram_basic` | |
* Facebook 和 Instagram 使用 `instagram_basic` |
Just be consistent. It would be so weird if one product name is translated and the other is not.
Personally speaking, it would be better to leave the names of the products as-is when the products
- don't provide service in China mainland.
- don't have an official translation of the product name in Chinese.
- are technically mentioned for development usage (In this case, readers will be more familiar with the English terms).
* Google 使用了 `https://www.googleapis.com/auth/drive` 。 | ||
* 常见用例为,`users:read` 或 `users:write` | ||
* 脸书和 Instagram 使用 `instagram_basic` | ||
* 谷歌使用 `https://www.googleapis.com/auth/drive` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 谷歌使用 `https://www.googleapis.com/auth/drive` | |
* Google 使用 `https://www.googleapis.com/auth/drive` |
|
||
!!! info | ||
在 OAuth2 中「作用域」只是一个声明所需特定权限的字符串。 | ||
!!! info "说明" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the line number consistent with the original text so that the git diff tool will not align the change incorrectly.
|
||
它有没有 `:` 这样的其他字符或者是不是 URL 都没有关系。 | ||
OAuth2 中,**作用域**只是声明指定权限的字符串。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OAuth2 中,**作用域**只是声明指定权限的字符串。 | |
OAuth2 中,「作用域」只是声明某种权限的字符串。 |
|
||
## 获取 `username` 和 `password` 的代码 | ||
|
||
现在,让我们使用 **FastAPI** 提供的实用工具来处理此问题。 | ||
接下来,使用 **FastAPI** 工具获取用户名与密码。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a reason why to leave out some words here. The wording seems to mean that FastAPI is a tool designed to get the username
and password
.
接下来,使用 **FastAPI** 工具获取用户名与密码。 | |
接下来,使用 **FastAPI** 提供的实用工具来获取用户名与密码。 |
Thanks @jaystone776! 🚀 And thanks for the reviews @Sefank, @xzmeng, @mkdir700! 🙇 I'll merge this one for now, but if there are changes needed on top we can handle them in additional PRs. 🤓 |
as title