-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Translate primitives any of playground examples into japanese #244
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
Translate primitives any of playground examples into japanese #244
Conversation
// JavaScriptの様に動的に扱ったり、 | ||
// 型システムの制限を回避することができます。 | ||
|
||
// any型を利用する良いケースはJSON parsingです |
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'm not confident here...
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.
IMO: 「JSONのparseです」が良さそう
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.
ここでのanyは推論されているものなので、「使用されている」のほうが自然かもしれません。
// any型を利用する良いケースはJSON parsingです | |
// any型が使用されている良い例はJSON.parseの結果です |
// any型を利用することで、型安全のトレードオフと引き換えに、 | ||
// よりオリジナルに近いJavaScriptコードを書くことができます。 | ||
|
||
// any型は、どんな型でも(neverを除いた)割り当て可能であり、 |
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.
[imo] 括弧はあってもなくても成立する文章にしたいです
// any型は、どんな型でも(neverを除いた)割り当て可能であり、 | |
// any型は、(neverを除いて)どんな型でも割り当て可能であり、 |
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.
コメントありがとうございます!該当箇所を修正しました
// JavaScriptの様に動的に扱ったり、 | ||
// 型システムの制限を回避することができます。 | ||
|
||
// any型を利用する良いケースはJSON parsingです |
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.
IMO: 「JSONのparseです」が良さそう
|
||
// TypeScriptにおけるAny宣言は、あなたがその値について詳しく知っていて | ||
// 安全なものなので信じてください、という宣言です。 | ||
// それが厳密に正しくない場合でも。例えば、次のコードはクラッシュします。 |
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.
IMO: 原文的にはこの並びなんですが、日本語としてはこなれていないので、ちょっと語順をいじるとこなれていい感じになると思います
// TypeScriptにおけるAny宣言は、あなたがその値について詳しく知っていて
// それが厳密に正しくないとしても、安全なものなので信じてくださいという宣言です。
// 例えば、次のコードはクラッシュします。
@@ -0,0 +1,51 @@ | |||
// AnyはTypeScriptのエスケープ句です。 |
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.
Anyかanyか統一した方がいいかも?
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.
any で統一しましょうか、実際にコードで使うのは any
ですし
|
||
myObject.x.y.z; | ||
|
||
// any型を利用することで、型安全のトレードオフと引き換えに、 |
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.
IMO: with the trade offで「引き換えに」になるのでトレードオフはなくても良さそう
// any型を利用することで、型安全のトレードオフと引き換えに、 | |
// any型を利用することで、型安全性と引き換えに、 |
// タプル型が初見の場合、example:tuples を参照してください。 | ||
|
||
// unknown型はany型の兄弟とも言うことができますが、 | ||
// any型は「最善策を知っています」という場合に利用する一方で、 |
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.
IMO:
// any型は「最善策を知っています」という場合に利用する一方で、 | |
// any型は「最善策を知っている」場合に利用する一方で、 |
// unknown型はany型の兄弟とも言うことができますが、 | ||
// any型は「最善策を知っています」という場合に利用する一方で、 | ||
// unknown型は「最善策が分からないので、TSに型を伝える必要があります」 | ||
// という場合に利用します。 |
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.
IMO:
// unknown型は「最善策が分からないので、TSに型を伝える必要がある」
// 場合に利用します。
|
||
const myObject = JSON.parse("{}"); | ||
|
||
// TypeScriptにおけるAny宣言は、あなたがその値について詳しく知っていて |
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.
// TypeScriptにおけるAny宣言は、あなたがその値について詳しく知っていて | |
// TypeScriptにおけるany宣言は、あなたがその値について詳しく知っていて |
// any型は「最善策を知っています」という場合に利用する一方で、 | ||
// unknown型は「最善策が分からないので、TSに型を伝える必要があります」 | ||
// という場合に利用します。 | ||
|
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.
[imo]原文はここに改行が無いので、それに合わせたいです。(原文に変更があった時にDiffをスムーズに受け入れられるように。)
@Naturalclar @sasurau4 ご指摘ありがとうございますー。修正しましたので再度ご確認お願いします 🙏 |
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
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.
Ready to merge
Ready to merge |
OK, I've validated all the CI autp-merge stuff - it's looking right except I'm waiting on the typescript bot getting access to the repo (It only does issue comments, but not review comments yet, will add that ) |
Overview
part of #100, #220
I translated Primitives Any playground-example.
@Naturalclar @Quramy @sasurau4 Please give me a review.