🌐 Add Chinese translation for Tutorial - Bigger Applications - Multiple Files#2453
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2453 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 243 243
Lines 7419 7419
=========================================
Hits 7419 7419 Continue to review full report at Codecov.
|
|
📝 Docs preview for commit 26a42ed at: https://5fc614470da6790de33d084c--fastapi.netlify.app |
|
|
||
| ### 导入 `APIRouter` | ||
|
|
||
| 你可以导入它并通过与 `FastAPI` 类相同的方式创建一个「实例」: |
There was a problem hiding this comment.
个人感觉 ‘the same way’ 应该包括导入这一步,不过影响不大 ![]()
| 你可以导入它并通过与 `FastAPI` 类相同的方式创建一个「实例」: | |
| 与使用 `FastAPI` 类的方式相同,你可以导入它并创建一个「实例」: |
| {!../../../docs_src/bigger_applications/app/routers/users.py!} | ||
| ``` | ||
|
|
||
| ### *路径操作*和 `APIRouter` |
There was a problem hiding this comment.
和下面翻译统一。with 此处翻译为‘使用‘感觉更合适。
| ### *路径操作*和 `APIRouter` | |
| ### 包含 `APIRouter` 的*路径操作* |
|
|
||
| 然后你可以使用它来声明*路径操作*。 | ||
|
|
||
| 通过与使用 `FastAPI` 类相同的方式使用它: |
There was a problem hiding this comment.
| 通过与使用 `FastAPI` 类相同的方式使用它: | |
| 与使用 `FastAPI` 类相同的方式使用它: |
| !!! tip | ||
| 最后的这个路径操作将包含标签的组合:`["items","custom"]`。 | ||
|
|
||
| 并且在文档中也会有两个响应,一个为 `404`,一个为 `403`。 |
There was a problem hiding this comment.
| 并且在文档中也会有两个响应,一个为 `404`,一个为 `403`。 | |
| 并且在文档中也会有两个响应,一个对应 `404`,一个对应 `403`。 |
| {!../../../docs_src/bigger_applications/app/main.py!} | ||
| ``` | ||
|
|
||
| ### 包含 `users` 和 `items` 的 `APIRouter` |
There was a problem hiding this comment.
include 虽然是‘包含‘的意思,但是这里直接翻译为‘包含‘感觉不太符合中文习惯。如果意译是否可以翻译为“添加”?
后面这段话,也说明了 include_router() 函数确实是‘添加‘路由到主程序。
With app.include_router() we can add each APIRouter to the main FastAPI application.
Co-authored-by: Shucai.wang <[email protected]>
|
📝 Docs preview for commit 2779ec5 at: https://5ffe5f2ed9428c4ce1fb85cf--fastapi.netlify.app |
|
📝 Docs preview for commit fe583ac at: https://5ffe6300de7c32599ff43f2c--fastapi.netlify.app |
|
Thanks @waynerv! 👏 👏 🚀 And thanks for the reviews @yanever , @blt232018 , and @Laineyzhang55 ☕ 🍰 |
@RunningIkkyu @maoyibo @yanever Please take a look.