Repository navigation
Translate faq-ajax - #10
Merged
Merged
Conversation
smikitky
self-requested a review
February 1, 2019 11:32
Jessidhia
reviewed
Feb 1, 2019
| ### AJAXコールするには? | ||
|
|
||
| You can use any AJAX library you like with React. Some popular ones are [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), and the browser built-in [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). | ||
| 任意のAJAXライブラリをReactと共に利用可能です。人気のあるものとしては、[Axios](https://github.com/axios/axios)、[jQuery AJAX](https://api.jquery.com/jQuery.ajax/)、ブラウザ組み込みの [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)などがあります。 |
There was a problem hiding this comment.
Member
There was a problem hiding this comment.
MDNのリンクはドキュメント中に数十カ所あるので、日本語版にはまとめて置換するほうが効率的かなということで、一応そのままにするという形でお願いしています。
87 of 90 tasks
smikitky
requested changes
Feb 1, 2019
smikitky
left a comment
Member
There was a problem hiding this comment.
大部分はスペースの置き方などの些細な問題なのですがご確認の上対応をお願いします。
| --- | ||
| id: faq-ajax | ||
| title: AJAX and APIs | ||
| title: AJAXとAPI |
Member
There was a problem hiding this comment.
Suggested change
| title: AJAXとAPI | |
| title: AJAX と API |
英字と和文との間に半角スペースをお願いします。 TRANSLATION.md をご一読ください。
| --- | ||
|
|
||
| ### How can I make an AJAX call? | ||
| ### AJAXコールするには? |
Member
There was a problem hiding this comment.
Suggested change
| ### AJAXコールするには? | |
| ### AJAX コールをする方法は? |
| ### AJAXコールするには? | ||
|
|
||
| You can use any AJAX library you like with React. Some popular ones are [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), and the browser built-in [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). | ||
| 任意のAJAXライブラリをReactと共に利用可能です。人気のあるものとしては、[Axios](https://github.com/axios/axios)、[jQuery AJAX](https://api.jquery.com/jQuery.ajax/)、ブラウザ組み込みの [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)などがあります。 |
Member
There was a problem hiding this comment.
Suggested change
| 任意のAJAXライブラリをReactと共に利用可能です。人気のあるものとしては、[Axios](https://github.com/axios/axios)、[jQuery AJAX](https://api.jquery.com/jQuery.ajax/)、ブラウザ組み込みの [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)などがあります。 | |
| 任意の AJAX ライブラリを React と共に利用可能です。人気のあるものとしては、[Axios](https://github.com/axios/axios)、[jQuery AJAX](https://api.jquery.com/jQuery.ajax/)、ブラウザ組み込みの [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) などがあります。 |
| 任意のAJAXライブラリをReactと共に利用可能です。人気のあるものとしては、[Axios](https://github.com/axios/axios)、[jQuery AJAX](https://api.jquery.com/jQuery.ajax/)、ブラウザ組み込みの [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)などがあります。 | ||
|
|
||
| ### Where in the component lifecycle should I make an AJAX call? | ||
| ### コンポーネントのどのライフサイクルでAJAXコールすべきか? |
Member
There was a problem hiding this comment.
Suggested change
| ### コンポーネントのどのライフサイクルでAJAXコールすべきか? | |
| ### コンポーネントのどのライフサイクルで AJAX コールすべきか? |
| ### コンポーネントのどのライフサイクルでAJAXコールすべきか? | ||
|
|
||
| You should populate data with AJAX calls in the [`componentDidMount`](/docs/react-component.html#mounting) lifecycle method. This is so you can use `setState` to update your component when the data is retrieved. | ||
| AJAXコールによるデータ取得は[`componentDidMount`](/docs/react-component.html#mounting)で行うと良いでしょう。データ取得後に `setState` でコンポーネントを更新できるようにするためです。 |
Member
There was a problem hiding this comment.
Suggested change
| AJAXコールによるデータ取得は[`componentDidMount`](/docs/react-component.html#mounting)で行うと良いでしょう。データ取得後に `setState` でコンポーネントを更新できるようにするためです。 | |
| AJAX コールによるデータ取得は [`componentDidMount`](/docs/react-component.html#mounting) のライフサイクルメソッドで行うべきです。データ取得後に `setState` でコンポーネントを更新できるようにするためです。 |
この should は React の思想的に比較的強い should だと思われるので強めにしました
| AJAXコールによるデータ取得は[`componentDidMount`](/docs/react-component.html#mounting)で行うと良いでしょう。データ取得後に `setState` でコンポーネントを更新できるようにするためです。 | ||
|
|
||
| ### Example: Using AJAX results to set local state | ||
| ### 例:AJAXの通信結果をローカルstateで利用する |
Member
There was a problem hiding this comment.
Suggested change
| ### 例:AJAXの通信結果をローカルstateで利用する | |
| ### 例:ローカル state に AJAX の通信結果をセットする |
| ### 例:AJAXの通信結果をローカルstateで利用する | ||
|
|
||
| The component below demonstrates how to make an AJAX call in `componentDidMount` to populate local component state. | ||
| 下記のコンポーネントは、 `componentDidMount` でAJAXコールして得られたデータをローカルコンポーネントのstateに流し込んでいます。 |
Member
There was a problem hiding this comment.
Suggested change
| 下記のコンポーネントは、 `componentDidMount` でAJAXコールして得られたデータをローカルコンポーネントのstateに流し込んでいます。 | |
| 下記のコンポーネントは、`componentDidMount` で AJAX コールして得られたデータをローカルコンポーネントの state に流し込んでいます。 |
| 下記のコンポーネントは、 `componentDidMount` でAJAXコールして得られたデータをローカルコンポーネントのstateに流し込んでいます。 | ||
|
|
||
| The example API returns a JSON object like this: | ||
| サンプルAPIが返すJSONオブジェクトはこのようになります: |
Member
There was a problem hiding this comment.
Suggested change
| サンプルAPIが返すJSONオブジェクトはこのようになります: | |
| このサンプル API が返す JSON オブジェクトはこのようなものです: |
Member
|
ありがとうございます! |
Contributor
Author
|
@smikitky レビューありがとうございます!諸々修正しましたのでご確認お願いいたします:pray: |
smikitky
approved these changes
Feb 2, 2019
Member
|
ありがとうございました! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of Issue #4.