Skip to content
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 React (top-level) API Reference #47

Merged
merged 28 commits into from Feb 14, 2019

Conversation

lightnet328
Copy link
Contributor

This PR is a part of #4.
Translate: React Top-Level API – React

Copy link
Member

@potato4d potato4d left a comment

Choose a reason for hiding this comment

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

Suspense までだけですが、 Lint 的に直したほうが良さそうなものがいくつかある & imo を書きました。スペース周りなどは下のほうにもあるのが見えたので、対応お願いいたします🙏

content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
@tesseralis tesseralis mentioned this pull request Feb 3, 2019
90 tasks
@smikitky smikitky changed the title Translate React API Reference Translate React (top-level) API Reference Feb 3, 2019
@smikitky smikitky self-requested a review February 3, 2019 01:26
Copy link
Member

@smikitky smikitky left a comment

Choose a reason for hiding this comment

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

長い記事でもあり大量になってしまい申し訳ありません。一旦こちらで対応をお願いします。

content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
@lightnet328
Copy link
Contributor Author

lightnet328 commented Feb 3, 2019

以下の修正を行いました。

  • 句読点の後のスペースを削除
  • 英数字の前後にスペース
    • 特に数字
    • 英字については主に漏れ
  • リンクの翻訳
    • 文の一部としてリンクされているもの
  • Reactの概念の訳に原文を併記
    • Fragment, Suspense
  • 原文にない余計な改行を削除
  • 訳の変更
    • "見てください" → "参照してください"
  • 提案していただいた、より適切な訳に修正

(コミットは割りとまとめてしまってます🙏)


This helper is considered legacy, and we encourage you to either use JSX or use `React.createElement()` directly instead.
このヘルパーはレガシーと見なされます。JSX `React.createElement()` を直接使用することを勧めます。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
このヘルパーはレガシーと見なされます。JSX`React.createElement()` を直接使用することを勧めます
このヘルパーはレガシーだと考えられているので、代わりにJSX`React.createElement()` を直接使用することをおすすめします


* * *

### `React.Children`

`React.Children` provides utilities for dealing with the `this.props.children` opaque data structure.
`React.Children` はデータ構造が非公開の `this.props.children` を扱うためのユーティリティを提供します。
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`React.Children` はデータ構造が非公開の `this.props.children` を扱うためのユーティリティを提供します。
`React.Children` はデータ構造が不明瞭な `this.props.children` を扱うためのユーティリティを提供します。

Copy link
Member

Choose a reason for hiding this comment

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

「データ構造が不明瞭な」だと訳が分からないので、これは「非公開」でいいと思いますが。もちろん React の中の人はデータ構造を知っているわけですし。 console.log(props.children) とかすれば中身は明瞭に見えます(ドキュメント化されていないReactの仮想DOMオブジェクト本体です)。


#### `React.Children.only`

```javascript
React.Children.only(children)
```

Verifies that `children` has only one child (a React element) and returns it. Otherwise this method throws an error.
`children` が 1 つの子要素しか持たないことを確認します。そうでない場合、このメソッドはエラーを投げます。
Copy link
Contributor

@takanorip takanorip Feb 3, 2019

Choose a reason for hiding this comment

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

Suggested change
`children` が 1 つの子要素しか持たないことを確認します。そうでない場合、このメソッドはエラーを投げます。
`children` が 1 つの子要素しか持たないことを確認し、その結果を返します。そうでない場合、このメソッドはエラーを投げます。

@koba04 koba04 self-requested a review February 4, 2019 01:16
takanorip and others added 5 commits February 4, 2019 12:33
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
@koba04 koba04 removed their request for review February 4, 2019 09:39
content/docs/reference-react.md Outdated Show resolved Hide resolved

- [`React.lazy`](#reactlazy)
- [`React.Suspense`](#reactsuspense)

* * *

## Reference
## レファレンス
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## レファレンス
## リファレンス

content/docs/reference-react.md Outdated Show resolved Hide resolved
content/docs/reference-react.md Outdated Show resolved Hide resolved
@smikitky
Copy link
Member

smikitky commented Feb 5, 2019

すみませんもう少しだけ対応をお願いします。

@smikitky
Copy link
Member

smikitky commented Feb 9, 2019

以下の3点のみ保留になっているので解決したいです。

opaque data structure の訳

この opaque の意味についてはここにあります。長く書くなら「インターフェースが公開ではないので中身をブラックボックスとして扱うべき」という意味でいいと思います。Reactの仮想DOMの実体(createElementの返り値であるオブジェクト)は、(console.logすることで「明瞭」に中身は見えますが)そのデータ構造は公開APIの一部ではないためオペークなデータです。「データ構造が不明瞭」ではこのような意図が伝わらず混乱を招きそうなので、「データ構造が非公開」が適切だと私は思います。改めて @takanorip さんのお考えはいかがですか。

for の訳抜け

It's similar to React.PureComponent but for function components instead of classes.

React.memo() は関数コンポーネントです」という訳になっていますがそれは端的に事実ではありません。「Rect.memo() は関数コンポーネントです」や「React.memo()は関数コンポーネントに対して使うものです」などとすべきだと思います。

you can wrap it in a call to React.memo for a performance boost

原文は「memoを呼んでラップする」が近く、現在の訳文は「memoでラップして呼ぶ」に近くなっています。正直私はどちらでも誤解の余地はないし、いっそ「memoでラップする」だけでも構いません。ただ @takanorip さんの提案の「memoの呼び出しでラップする」は(間違いではないでしょうが)少しこなれていない印象を個人的には受けます。いろいろ考えた結果「memoを呼んでラップする」が一番無難だと思いますが、如何でしょう。

smikitky and others added 3 commits February 10, 2019 20:44
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
Co-Authored-By: lightnet328 <lightnet328@gmail.com>
@lightnet328
Copy link
Contributor Author

対応が滞ってしまい、申し訳ありません。
HoCについては、"コンポーネントを返す関数"との理解から誤訳してしまったと思います(それでもコンポーネントではないので仰る通り事実ではありませんが・・・)。提案いただいた変更を取り込ませていただきました。
他の2点についてもご説明いただいている理由に同意します。

@smikitky
Copy link
Member

@lightnet328 もしもお忙しいようでしたらこちらで引き取って残りの作業を終わらせますが、如何しますか?

@lightnet328
Copy link
Contributor Author

@smikitky すみません、残りの作業というのは React.Component (https://reactjs.org/docs/react-component.html) の翻訳のことでしょうか?遅くなってしまい大変申し訳ありませんが、本日まで作業ができなかったのでこれから進めていきたいと思っています。よろしくお願いいたします。

@smikitky
Copy link
Member

申し訳ありません、確かめたところ残っていたのは「レファレンス → リファレンス」だけのようで、ほかは対応頂いているようです。opaque と wrap it in a call の件は @takanorip さんから1週間ほど反応がないですが、私は現状のもので問題ありません。

Copy link
Member

@smikitky smikitky left a comment

Choose a reason for hiding this comment

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

何度も本当に申し訳ありません、textlintがこれだけエラーになっているので修正をお願いします

content/docs/reference-react.md Outdated Show resolved Hide resolved
@lightnet328
Copy link
Contributor Author

Outdated になっていたため、修正したものと勘違いしていました。
途中から Suggestion をそのまま Commit させていただいていましたが、見落としを防ぐためにも一貫するべきだと思いました。考慮不足でした・・・。
"レファレンス"のご指摘についてとLint errorを修正しました。

Co-Authored-By: lightnet328 <lightnet328@gmail.com>
@takanorip
Copy link
Contributor

コメント遅くなってしまいましたが、現状のもので大丈夫だと思います。ありがとうございます!

@potato4d potato4d merged commit 9438c07 into reactjs:master Feb 14, 2019
@smikitky
Copy link
Member

@lightnet328 @takanorip @potato4d ありがとうございました!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants