Skip to content

Translate reference-test-renderer #11

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

Merged
merged 20 commits into from
Feb 2, 2019
Merged

Conversation

queq1890
Copy link
Contributor

@queq1890 queq1890 commented Feb 1, 2019

Related Issue : #4
I've made a translation for reference-test-renderer.md

@smikitky レビューをお願いいたします 🙇

@smikitky smikitky self-requested a review February 1, 2019 11:31
@tesseralis tesseralis mentioned this pull request Feb 1, 2019
90 tasks
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.

幾つか変更をお願いしたい点がありますのでご確認お願いします。


Essentially, this package makes it easy to grab a snapshot of the platform view hierarchy (similar to a DOM tree) rendered by a React DOM or React Native component without using a browser or [jsdom](https://github.com/tmpvar/jsdom).
基本的には、このパッケージはプラットフォームにおいて、(DOM ツリーと同様の)ビューの階層構造のスナップショットの取得を容易にするものです。ビューの階層構造は、ブラウザや [jsdom](https://github.com/tmpvar/jsdom) を利用せずに React DOM もしくは React Native コンポーネントからレンダリングされます。
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
基本的には、このパッケージはプラットフォームにおいて、(DOM ツリーと同様の)ビューの階層構造のスナップショットの取得を容易にするものです。ビューの階層構造は、ブラウザや [jsdom](https://github.com/tmpvar/jsdom) を利用せずに React DOM もしくは React Native コンポーネントからレンダリングされます
本質的ににこのパッケージは、ブラウザや [jsdom](https://github.com/tmpvar/jsdom) を利用しなくても、React DOM React Native コンポーネントがレンダーする(DOM ツリーに似た)ビューの階層構造のスナップショットを容易に取得できるようにするためのものです

こちらも文を分けてしまうと逆に意図が間違って伝わると思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

こちらのSuggestion のみ誤字(本質的ににこ...)がありましたのでコミット分けさせていただきました 🙇

@queq1890
Copy link
Contributor Author

queq1890 commented Feb 1, 2019

レビューありがとうございます!スタイルのミス / 訳語の選び方のミス / 訳漏れ等多く申し訳ないです。
頂いたSuggestionの適用と文章の修正をさせていただきます。

@smikitky
Copy link
Member

smikitky commented Feb 1, 2019

1個だけsuggestionがそのままになっているっぽいので確認をお願いします。あと他にも翻訳を確認したい人がいるようですのでマージまで少し時間を置くかもしれませんがご了承ください。

@smikitky
Copy link
Member

smikitky commented Feb 1, 2019

LGTM, let me wait for other potential reviewers

Copy link
Contributor

@sasurau4 sasurau4 left a comment

Choose a reason for hiding this comment

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

Thanks for translating!


翻訳お疲れ様です。:+1:
細かいところの指摘をしました。IMOつけたところもあるので、コメント歓迎です 👍


### `testRenderer.getInstance()`

```javascript
testRenderer.getInstance()
```

Return the instance corresponding to the root element, if available. This will not work if the root element is a function component because they don't have instances.
存在する場合、ルート要素と対応したインスタンスを返します。関数コンポーネントはインスタンスを持たないため、ルート要素が関数コンポーネントの場合、このメソッドはうまく動作しません。
Copy link
Contributor

Choose a reason for hiding this comment

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

  • 存在する場合 -> 可能な場合の方が分かりやすいかと思います
    もっといえば、「Class Componentの場合」にするのが一番近い気はするんですがさすがに意訳すぎるかもしれません

Copy link
Member

@smikitky smikitky Feb 2, 2019

Choose a reason for hiding this comment

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

「可能な場合」の方が条件が曖昧になる気がします。「ルート要素に対応したインスタンスがある場合はそれを返します」でもよいと思います

Copy link
Contributor Author

@queq1890 queq1890 Feb 2, 2019

Choose a reason for hiding this comment

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

「可能な場合」の訳でも「存在する場合」の訳でも、読み手からすると具体的にどんな場合なのかを想像しにくいかもしれませんね。 条件の説明と、何を返すかの説明がはっきりしている「ルート要素に対応したインスタンスがある場合はそれを返します」が良いと思うのですが、いかがでしょうか?


### `testInstance.find()`

```javascript
testInstance.find(test)
```

Find a single descendant test instance for which `test(testInstance)` returns `true`. If `test(testInstance)` does not return `true` for exactly one test instance, it will throw an error.
`test(testInstance)` `true` を返す単一の子テストインスタンスを検索します。もし `test(testInstance)` に対して `true` を返すテストインスタンスの数がちょうど 1 でない場合は、エラーがスローされます。
Copy link
Contributor

Choose a reason for hiding this comment

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

− IMO: 「エラーがスローされます」より「エラーが発生します」の方が分かりやすいと思います。ただ、日本語的には後者なんですが、エンジニアなら前者のほうが直感的かも知れないです。他の人の意見が欲しいです。

Copy link
Member

Choose a reason for hiding this comment

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

これはもうスローでいいと思います、「エラーが発生」だと原文にある情報が失われてしまうと思います

Copy link
Contributor Author

@queq1890 queq1890 Feb 2, 2019

Choose a reason for hiding this comment

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

ここは原文の throw an error を残すためにスローのままキープさせていただきます 👍

@smikitky
Copy link
Member

smikitky commented Feb 2, 2019

@sasurau4 ありがとうございます。

差分サジェスト機能を使うとレビューをされた側がクリックするだけでそれをアクセプトするコミットを作れるのでおすすめです。https://qiita.com/ykhirao/items/5a854bb2548763a2196b

@queq1890
Copy link
Contributor Author

queq1890 commented Feb 2, 2019

@sasurau4 レビューありがとうございます!取り急ぎ、IMO ついていないご指摘箇所の修正をさせていただきます。

(Masterからのrebaseも)

@queq1890
Copy link
Contributor Author

queq1890 commented Feb 2, 2019

@sasurau4 @smikitky
IMO頂いた箇所、議論のあったtestRenderer.getInstance() の部分を含め、翻訳を修正させていただきました。お手すきで再度ご確認をお願いいたします 🙇

@smikitky smikitky merged commit b118a2a into reactjs:master Feb 2, 2019
@smikitky
Copy link
Member

smikitky commented Feb 2, 2019

ありがとうございました!

@queq1890
Copy link
Contributor Author

queq1890 commented Feb 2, 2019

こちらこそありがとうございました 🙏

@queq1890 queq1890 deleted the test-renderer branch February 2, 2019 06:54
@sasurau4
Copy link
Contributor

sasurau4 commented Feb 2, 2019

ありがとうございました! 👍

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.

6 participants