-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Translate v2 docs in Japanese. #428
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
Conversation
|
||
1. Vuex ストアはリアクティブです。 Vue コンポーネントがストアから状態を取り出すとき、もしストアの状態が変化したら、ストアはリアクティブかつ効率的に更新を行います。 | ||
|
||
2. ストアの状態を直接変更することはできません。明示的に**ミューテーションをコミットする**ことによってのみ、ストアの状態を変更します。これによって、全ての状態の変更について追跡可能な記録を残すことが保証され、ツールでのアプリケーションの動作の理解を助けます。 |
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.
- You cannot directly mutate the store's state. The only way to change a store's state is by explicitly committing mutations. This ensures every state change leaves a track-able record, and enables tooling that helps us better understand our applications.
I am not really sure about the translation of "committing mutations".
Which do you think is the best?
- ミューテーションをコミットする
- ミューテーションを送る
- another idea?
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.
メソッド名と対応しているので「ミューテーションをコミットする」が良いと思います。
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.
ありがとうございます!「ミューテーションをコミットする」でいこうと思います!
@kitak |
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.
翻訳しながら理解できなかった部分について自分でコメントを書きました。フィードバックよろしくお願いします。
rootState // store.state と同じ | ||
``` | ||
|
||
登録されたゲッターは `store.getters` 上で外から見えるようになります。 |
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.
exposeをどう訳すと良いかがわからず「外から見える」と訳しています
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.
「公開されます」はどうでしょうか?
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.
なるほど!そのほうがしっくりきますね。修正します。
|
||
- **`dispatch(mutationName: String, ...args) | dispatch(mutation: Object)`** | ||
|
||
アクションをディスパッチします。すべてのトリガーされたアクションハンドラを解決するプロミスを返します。[詳細](actions.md) |
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.
上の他の方の翻訳例を見るとPromiseはPromiseのままのようなので、そちらに合わせるよう修正します。
|
||
- **`mapActions(map: Array<string> | Object): Object`** | ||
|
||
アクションをディスパッチするコンポーネントメソッドオプションを作成します。[詳細](actions.md#dispatching-actions-in-components) |
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.
component methods optionsという単語ひとかたまりかと思って訳してしまっているのですが、間違っている気がしています…。
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.
コンポーネントのメソッドオプション
でどうでしょうか?
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.
確かに、そのほうが何のことかがもう少しわかりやすくなりますね。修正します。
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.
いっそのこと、メソッドはプロパティ名のままで コンポーネントの methods オプション
とかどうでしょうか。
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.
なるほどです。無理に全部日本語にしようとしないほうがわかりやすそうですね。
コンポーネントの methods オプション
で修正します。
|
||
- **`replaceState(state: Object)`** | ||
|
||
ストアのルートステートを置き換えます。これは、ステートの水和やタイムトラベルのためだけに利用すべきです。 |
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.
hydrationの訳もどうしていいものかわかりませんでした。
直訳だと水和であってると思うのですが、何かのジョークなのか?とも思ってよくわからないですね…。
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.
hydration はハイドレーションでいいと思います。Server Side Rendering の用語です。
|
||
- 型: `Object` | ||
|
||
Vuex store のための ルートステートオブジェクトです。 |
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.
他の方の翻訳ではストアと書かれてるので、 s/store/ストア/ していただけますか?
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.
確かに。1.0のときにままにしていました。置き換えます。
|
||
- 型: `{ [type: string]: Function }` | ||
|
||
Vuex storeにミューテーションを登録します。ハンドラ関数は第一引数に `state` を常に受け取り(またモジュール内で定義されていれば、ローカルステートをモジュール化し)、指定されていれば第二引数に `payload` を受け取ります。 |
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.
ローカルステートをモジュール化し
「モジュールのローカルステートを受け取り」が原文の意味として正しいですね。
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.
確かに be moduled ではないですね。修正します。
|
||
``` js | ||
{ | ||
state, // store.state と同じか, or モジュール内にあればローカルステート |
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.
or はとりましょう!
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.
消し忘れていました…。消します。
Vuex storeにゲッターを登録します. ゲッター関数は次の引数を受け取ります: | ||
|
||
``` | ||
state, // モジュール内で定義されていればローカルステートをモジュール化します |
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.
ローカルステートをモジュール化します
「モジュールのローカルステートとなります」が原文の意味として正しいですね。
} | ||
``` | ||
|
||
各モジュールは、ルートオプションに似た `state` と `mutations` を含むことができます。モジュールの状態は、モジュールのキーを使って、ストアのルートステートにアタッチされます。モジュールのミューテーションとゲッターは、第一引数としてルートステートの代わりに、モジュールのローカルステートだけを受け取り、モジュールのアクションの `context.state` もローカルステートを指すようになります。 |
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.
アタッチされます
結合されます。とかでどうでしょうか?
store.subscribe((mutation, state) => { | ||
console.log(mutation.type) | ||
console.log(mutation.payload) | ||
}) |
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.
インデントが微妙にずれてますね。
}) | ||
``` | ||
|
||
もっともよく利用されるプラグインです。[詳細](plugins.md) |
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.
Most commonly used in plugins
なので、プラグイン内でよく使われると言う意味になります。
|
||
- **`hotUpdate(newOptions: Object)`** | ||
|
||
新しいアクションとミューテーションでホットスワップします。[詳細](hot-reload.md) |
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.
こまかいですが、new actions and mutations は目的格なので で ではなく を だと思います。
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.
確かに で はおかしいですね。修正します。
|
||
- **`mapState(map: Array<string> | Object): Object`** | ||
|
||
Vuex storeのサブツリーを返すオプションを計算したコンポーネントを作成します。[詳細](state.md#the-mapstate-helper) |
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.
Create component computed options
は「コンポーネントの算出プロパティオプションを作成する」で、
that return the sub tree of the Vuex store
はそのオプションが「Vuex ストアのサブツリーを返す」ことを意味しています。
|
||
- **`mapGetters(map: Array<string> | Object): Object`** | ||
|
||
ゲッターの評価後の値を返すオプションを計算したコンポーネントを作成します。[詳細](getters.md#the-mapgetters-helper) |
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.
こちらも上記と同様に、作成するのは「コンポーネントの算出プロパティオプション」です。
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.
下の methods と合わせて computed オプションにしても良いかもしれません
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.
なるほど。上のコメントも合わせてありがとうございます。
computedオプションにしてしまおうと思います。
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.
コメントをいただいた部分の修正を行いました。ご確認よろしくお願いします。
|
||
``` js | ||
{ | ||
state, // store.state と同じか, or モジュール内にあればローカルステート |
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.
消し忘れていました…。消します。
|
||
- 型: `Object` | ||
|
||
Vuex store のための ルートステートオブジェクトです。 |
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.
確かに。1.0のときにままにしていました。置き換えます。
|
||
- 型: `{ [type: string]: Function }` | ||
|
||
Vuex storeにミューテーションを登録します。ハンドラ関数は第一引数に `state` を常に受け取り(またモジュール内で定義されていれば、ローカルステートをモジュール化し)、指定されていれば第二引数に `payload` を受け取ります。 |
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.
確かに be moduled ではないですね。修正します。
|
||
ストアのルートステートを置き換えます。これは、ステートの水和やタイムトラベルのためだけに利用すべきです。 | ||
|
||
- **`watch(getter: Function, cb: Function, [options: Object])`** |
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.
https://github.com/vuejs/vuex/blob/dev/docs/en/api.md
でも (state: Object)
になっているように思いますが、間違っていますでしょうか?
下の options?: Object
にならないといけないところですね。失礼いたしました。修正します。
|
||
- **`hotUpdate(newOptions: Object)`** | ||
|
||
新しいアクションとミューテーションでホットスワップします。[詳細](hot-reload.md) |
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.
確かに で はおかしいですね。修正します。
``` | ||
|
||
もっともよく利用されるプラグインです。[詳細](plugins.md) | ||
プラグインの中でももっともよく利用されます。[詳細](plugins.md) |
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.
何度もすみません。この訳だと、 subscribe
∈ プラグイン という意味になってしまうと思います。
この文で言いたいのは、この subscribe
メソッドの使い道として、それぞれの Vuex プラグインの中で使われることを想定しているということなので、中でも
ではなく 中で
が良いんじゃないかと思います。
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.
なるほど!完全に勘違いしていました!
プラグイン内で利用されることがある、ということですね…。
修正します。
Could you please merge it? |
@kitak @inouetakuya @tadyjp @kimikimi714 |
OK. I've done them. |
Thanks! I'm merging this. |
Deployed 🎉 https://vuex.vuejs.org/ja/ |
TODO