Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-models.md#1941

Merged
tiangolo merged 21 commits into
fastapi:masterfrom
SwftAlpc:translation/ja-tutorial-extra-models
Jan 15, 2024
Merged

🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-models.md#1941
tiangolo merged 21 commits into
fastapi:masterfrom
SwftAlpc:translation/ja-tutorial-extra-models

Conversation

@SwftAlpc

@SwftAlpc SwftAlpc commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

This PR translates the tutorial/extra-models.md to Japanese.
Please review tutorial/extra-models.md

Issue #1571 generates a new directory to support Japanese.
PR #1656 generates a new directory for tutorial.
I will fix dependency after #1571 & #1656 are merged.

@codecov

codecov Bot commented Aug 21, 2020

Copy link
Copy Markdown

Codecov Report

Patch and project coverage have no change.

Comparison is base (cf73051) 100.00% compared to head (e7b32fa) 100.00%.

❗ Current head e7b32fa differs from pull request most recent head 4b6e845. Consider uploading reports for the commit 4b6e845 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##            master     #1941     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          540       239    -301     
  Lines        13969      7079   -6890     
===========================================
- Hits         13969      7079   -6890     

see 356 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit 01c233f at: https://5f3fe3fb73d0e97772ee935f--fastapi.netlify.app

@SwftAlpc SwftAlpc mentioned this pull request Aug 23, 2020
@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit fac0a58 at: https://5f424ef9a293b75f104a998a--fastapi.netlify.app

@tiangolo tiangolo added awaiting-review lang-all Translations lang-ja Japanese translations labels Aug 29, 2020
@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit cec7a6c at: https://5f4cbf5cb850660e0943d2cb--fastapi.netlify.app

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated
@@ -0,0 +1,195 @@
# 追加モデル

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

モデル - より詳しく

(extraはいい訳がないので、がっつり意訳しないと不自然な気がします。目次を見ると、Response Modelsの次がこのセクションで、Response Modelsで紹介しなかったことをより詳しく紹介している章なのでこの様な見出しはどうでしょうか)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

良い和訳だと思います!修正しました

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated
これはユーザーモデルの場合は特にそうです。なぜなら:

* **入力モデル** にはパスワードが必要です。
* **出力モデル**にはパスワードを設定すべきではありません。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • 出力モデルはパスワードをもつべきではありません。

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated
* **データベースモデル**はおそらくハッシュ化されたパスワードが必要になるでしょう。

!!! danger "危険"
ユーザーの平文のパスワードは絶対に保存しないでください。常に「安全なハッシュ」を保存し、それを確認することができます。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ユーザーの平文のパスワードは絶対に保存しないでください。常に認証に利用可能な「安全なハッシュ」を保存してください。

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated

## 複数のモデル

ここでは、モデルのパスワードフィールドと使用場所でモデルがどのように見えるのか、大まかなイメージを紹介します:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ここでは、パスワードフィールドをもつモデルがどのように見えるのか、また、どこで使われるのか、大まかなイメージを紹介します:

user_dict = user_in.dict()
```

これで変数`user_dict`のデータを持つ`dict`ができました。(これはPydanticモデルのオブジェクトの代わりに`dict`です)。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

これで変数user_dictのデータを持つdictができました。(これはPydanticモデルのオブジェクトの代わりになるdictです)。

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated
```Python
UserInDB(
username = user_dict["username"],
password = user_dict["password"],これやばい

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

password = user_dict["password"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

変な日本語入ってましたね...;;
修正しました!

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated
)
```

#### 別の内容からのPydanticモデル

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

別のモデルからつくるPydanticモデル

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated

## `Union`または`anyOf`

レスポンスを2つの型の`Union`と宣言することができます。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

レスポンスを2つの型のUnionとして宣言することができます。

Comment thread docs/ja/docs/tutorial/extra-models.md Outdated

複数のPydanticモデルを使用し、ケースごとに自由に継承します。

エンティティが異なる「状態」を持つことができる必要がある場合は、ケンティティごとに単一のデータモデルを持つ必要はありません。ユーザー「エンティティ」の場合と同様に、`password`や`password_hash`を含み、パスワードはありません。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

エンティティが異なる「状態」を持てなければならない場合は、エンティティごとに単一のデータモデルを持つ必要はありません。passwordpassword_hashやパスワードなしなどのいくつかの「状態」をもつユーザー「エンティティ」の場合の様にすれば良いのです。

@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit 1164fea at: https://5f9aa712efcb983ab7c43051--fastapi.netlify.app

@SwftAlpc

Copy link
Copy Markdown
Contributor Author

@tokusumi
Thanks for the review!
I apologize for taking so long to respond.
Could you re-review?

@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit e7b32fa at: https://5f9aa94d5f755e2598dad129--fastapi.netlify.app

@tokusumi tokusumi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

your awesome works are really helpful. Thank you🎉

@tiangolo tiangolo changed the title Add tutorial/extra-models.md. Japanese ver. 🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-models.md Jun 26, 2023
@tiangolo tiangolo added lang-ja Japanese translations awaiting-review and removed lang-ja Japanese translations awaiting-review labels Jun 26, 2023
@tiangolo

Copy link
Copy Markdown
Member

📝 Docs preview for commit 4b6e845 at: https://6499c2f1bac8cd0083555671--fastapi.netlify.app

@tiangolo

Copy link
Copy Markdown
Member

As this was done by @SwftAlpc and reviewed by @tokusumi, champions of the Japanese translations, I'm gonna merge this. 🚀

@tiangolo tiangolo merged commit c238292 into fastapi:master Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review lang-all Translations lang-ja Japanese translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants