🌐 Add Japanese translation for Tutorial - Middleware#2255
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2255 +/- ##
=========================================
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 4e72e49 at: https://5f985b1cf4a786097cc1cf21--fastapi.netlify.app |
delhi09
left a comment
There was a problem hiding this comment.
It looks mostly good.
I pointed out some details.
|
|
||
| * ミドルウェアはアプリケーションに届いたそれぞれの**リクエスト**を受け取ります。 | ||
| * その後、その**リクエスト**に対して何かを実行したり、必要なコードを実行したりできます。 | ||
| * 次に、アプリケーションの残りの部分**リクエスト**を渡して (*path operation* によって) 処理させます。 |
There was a problem hiding this comment.
This sentence lacks "に" after "アプリケーションの残りの部分".
|
|
||
| **FastAPI** アプリケーションにミドルウェアを追加できます。 | ||
|
|
||
| 「ミドルウェア」は、特定の*path operation*によって処理される前に、すべての**リクエスト**に機能する関数です。また、それを返す前に、すべての**レスポンス**に機能します。 |
There was a problem hiding this comment.
It's better to modify "それ" to "レスポンス" because "それ" comes first, I don't know it refers to "レスポンス".
There was a problem hiding this comment.
It seems unnatural that the same word appears twice in one short sentence.
But I have updated this line to make it more natural, so please check it again.
| !!! tip "豆知識" | ||
| <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">'X-'プレフィックスを使用</a>してカスタムの独自ヘッダーを追加できます。 | ||
|
|
||
| ただし、ブラウザのクライアントに表示させたいカスタムヘッダーがある場合は、<a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">StarletteのCORSドキュメント</a>に記載されているパラメータ `expose_headers` を使用して、それらをCORSに追加する必要があります ([CORS (オリジン間リソース共有)](cors.md){.internal-link target=_blank}) |
There was a problem hiding this comment.
"CORS設定に追加する必要があります" may be a little better.
|
|
||
| ### `response` の前後 | ||
|
|
||
| *path operation* が `request` を受け取る前に、 `request` と実行されるコードを追加できます。 |
There was a problem hiding this comment.
"requestと共に or 一緒に" may be a little better.
|
Thank you for your review! @delhi09 |
|
📝 Docs preview for commit 671e5f0 at: https://5fe314603702e706b1e7a3a7--fastapi.netlify.app |
sh0nk
left a comment
There was a problem hiding this comment.
Just a couple of suggestions to aim more natural representation!
Co-authored-by: Sho Nakamura <[email protected]>
Co-authored-by: Sho Nakamura <[email protected]>
|
📝 Docs preview for commit 78b129e at: https://6001cf851287b966927b0359--fastapi.netlify.app |
|
Thank you for your review @sh0nk ! |
This PR translates tutorial/middleware.md with Japanese.