From 10bf50670caa0dbc9759552ae16df3a09986dd50 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:03:59 +0900 Subject: [PATCH 1/8] pick up translation from #1252 --- docs/ja/essentials/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/essentials/navigation.md b/docs/ja/essentials/navigation.md index 82745ca81..4063e0e2d 100644 --- a/docs/ja/essentials/navigation.md +++ b/docs/ja/essentials/navigation.md @@ -16,7 +16,7 @@ 引数は文字列のパス、もしくは、location を記述するオブジェクトが使えます。例: ``` js -// 文字列 +// 文字列パス router.push('home') // オブジェクト From 9549ee0f8d1296ae36e8f3208f47a4ab0664fd30 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:05:56 +0900 Subject: [PATCH 2/8] pick up translation from #1307 --- docs/ja/api/component-injections.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/ja/api/component-injections.md b/docs/ja/api/component-injections.md index b1dc4f20e..f8bcc2676 100644 --- a/docs/ja/api/component-injections.md +++ b/docs/ja/api/component-injections.md @@ -15,6 +15,7 @@ ### Enabled Options - **beforeRouteEnter** +- **beforeRouteUpdate** (2.2 で追加) - **beforeRouteLeave** [コンポーネント内ガード](../advanced/navigation-guards.md#incomponent-guards) をご参照ください。 From 885697328f19efc533ea1c398f7a832f0ba6b172 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:06:45 +0900 Subject: [PATCH 3/8] translation --- docs/ja/api/component-injections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/api/component-injections.md b/docs/ja/api/component-injections.md index f8bcc2676..b15482024 100644 --- a/docs/ja/api/component-injections.md +++ b/docs/ja/api/component-injections.md @@ -12,7 +12,7 @@ 現在のアクティブな [ルート](route-object.md) 。このプロパティは読み出しのみ可能かつ変更不可ですが、watch は可能です。 -### Enabled Options +### 有効になるオプション - **beforeRouteEnter** - **beforeRouteUpdate** (2.2 で追加) From c6f8b8e29aa49c986bced825736942a483876b0f Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:08:14 +0900 Subject: [PATCH 4/8] pick up from #1304 --- docs/ja/essentials/navigation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ja/essentials/navigation.md b/docs/ja/essentials/navigation.md index 4063e0e2d..a93125b1f 100644 --- a/docs/ja/essentials/navigation.md +++ b/docs/ja/essentials/navigation.md @@ -4,6 +4,8 @@ #### `router.push(location, onComplete?, onAbort?)` +**Note: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`.** + 異なる URL へ遷移するときに `router.push` が使えます。このメソッドは history スタックに新しいエントリを追加します。それによってユーザーがブラウザの戻るボタンをクリックした時に前の URL に戻れるようになります。 From 85df03d432bc310aa959c654e1813538e02d4b48 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:11:09 +0900 Subject: [PATCH 5/8] translate previous commit --- docs/ja/essentials/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/essentials/navigation.md b/docs/ja/essentials/navigation.md index a93125b1f..dcacefffc 100644 --- a/docs/ja/essentials/navigation.md +++ b/docs/ja/essentials/navigation.md @@ -4,7 +4,7 @@ #### `router.push(location, onComplete?, onAbort?)` -**Note: Inside of a Vue instance, you have access to the router instance as `$router`. You can therefore call `this.$router.push`.** +**注意: Vue インスタンスの内部では、`$router` としてルーターインスタンスにアクセスする必要があります。従って、`this.$router.push` で呼ぶことができます。** 異なる URL へ遷移するときに `router.push` が使えます。このメソッドは history スタックに新しいエントリを追加します。それによってユーザーがブラウザの戻るボタンをクリックした時に前の URL に戻れるようになります。 From 9196eabd6c6d91c19267b06101da5eebe1ee4f4a Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:18:08 +0900 Subject: [PATCH 6/8] pick up from 9b7f76646ec5a7c445ef3544847d89749845658c --- docs/ja/advanced/navigation-guards.md | 12 +++++++----- docs/ja/api/options.md | 8 ++++++++ docs/ja/api/router-instance.md | 16 +++++++++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 2196c705e..698eb3308 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -20,11 +20,11 @@ router.beforeEach((to, from, next) => { 全てのガード関数は 3 つの引数を受け取ります。 -- **`to: Route`**: 次にナビゲーションされる対象の [ルートオブジェクト](../api/route-object.md)。 - -- **`from: Route`**: ナビゲーションされる前の現在のルートです。 - -- **`next: Function`**: フックを **解決** するためにこの関数を呼ぶ必要があります。この振る舞いは `next` に渡される引数に依存します: + - **`to: Route`**: 次にナビゲーションされる対象の [ルートオブジェクト](../api/route-object.md)。 + + - **`from: Route`**: ナビゲーションされる前の現在のルートです。 + + - **`next: Function`**: フックを **解決** するためにこの関数を呼ぶ必要があります。この振る舞いは `next` に渡される引数に依存します: - **`next()`**: パイプラインの次のフックに移動します。もしフックが残っていない場合は、このナビゲーションは **確立** されます。 @@ -32,6 +32,8 @@ router.beforeEach((to, from, next) => { - **`next('/')` or `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。 + - **`next(error)`**: (2.4.0+) if the argument passed to `next` is an instance of `Error`, the navigation will be aborted and the error will be passed to callbacks registered via `router.onError()`. + グローバル after フックを登録することもできます。しかしながら、ガードとは異なり、これらのフックは `next` 関数を受け取らず、ナビゲーションに影響しません。 ``` js diff --git a/docs/ja/api/options.md b/docs/ja/api/options.md index 8ed64ea38..3face371b 100644 --- a/docs/ja/api/options.md +++ b/docs/ja/api/options.md @@ -67,3 +67,11 @@ ``` より詳細ついては [スクロールの振る舞い](../advanced/scroll-behavior.md) をご参照ください。 + +### parseQuery / stringifyQuery + +> 2.4.0+ + +- type: `Function` + + Provide custom query string parse / stringify functions. Overrides the default. diff --git a/docs/ja/api/router-instance.md b/docs/ja/api/router-instance.md index 84e37c1bd..8aac77279 100644 --- a/docs/ja/api/router-instance.md +++ b/docs/ja/api/router-instance.md @@ -60,10 +60,24 @@ 動的にルートをルーターに追加します。引数は `routes` コンストラクタオプションで同じルート設定形式を使用する配列でなければなりません。 -- **router.onReady(callback)** +- **router.onReady(callback, [errorCallback])** > 2.2.0+ このメソッドは、ルーターが初期ナビゲーションを完了したときに呼び出されるコールバックをキューに入れます。つまり、初期ルートに関連付けられているすべての非同期 enter フックと非同期コンポーネントを解決したことを意味します。 これは、サーバーとクライアントの両方で一貫した出力を保証するために、サーバーサイドレンダリングに役立ちます。 + + The second argument `errorCallback` is only supported in 2.4+. It will be called when the initial route resolution runs into an error (e.g. failed to resolve an async component). + +- **router.onError(callback)** + + > 2.4.0+ + + Register a callback which will be called when an error is caught during a route navigation. Note for an error to be called, it must be one of the following scenarios: + + - The error is thrown synchronously inside a route guard function; + + - The error is caught and asynchronously handled by calling `next(err)` inside a route guard function; + + - An error occurred when trying to resolve an async component that is required to render a route. From 6939954ac0caff9d10c52c4f28d3c78ed7790b73 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 9 Apr 2017 01:46:57 +0900 Subject: [PATCH 7/8] translate previous commit --- docs/ja/advanced/navigation-guards.md | 4 ++-- docs/ja/api/options.md | 4 ++-- docs/ja/api/router-instance.md | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/ja/advanced/navigation-guards.md b/docs/ja/advanced/navigation-guards.md index 698eb3308..9fe7aaf86 100644 --- a/docs/ja/advanced/navigation-guards.md +++ b/docs/ja/advanced/navigation-guards.md @@ -30,9 +30,9 @@ router.beforeEach((to, from, next) => { - **`next(false)`**: 現在のナビゲーションを中止します。もしブラウザのURLが変化した場合は(ユーザーが手動で変更した場合でも、戻るボタンの場合でも)、 `from` ルートのURLにリセットされます。 - - **`next('/')` or `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。 + - **`next('/')` または `next({ path: '/' })`**: 異なる場所へリダイレクトします。現在のナビゲーションは中止され、あたらしいナビゲーションが始まります。 - - **`next(error)`**: (2.4.0+) if the argument passed to `next` is an instance of `Error`, the navigation will be aborted and the error will be passed to callbacks registered via `router.onError()`. + - **`next(error)`**: (2.4.0+) `next` に渡された引数が `Error` インスタンスである場合、ナビゲーションは中止され、エラーは `router.onError()` を介して登録されたコールバックに渡されます。 グローバル after フックを登録することもできます。しかしながら、ガードとは異なり、これらのフックは `next` 関数を受け取らず、ナビゲーションに影響しません。 diff --git a/docs/ja/api/options.md b/docs/ja/api/options.md index 3face371b..56591043f 100644 --- a/docs/ja/api/options.md +++ b/docs/ja/api/options.md @@ -72,6 +72,6 @@ > 2.4.0+ -- type: `Function` +- 型: `Function` - Provide custom query string parse / stringify functions. Overrides the default. + カスタムクエリ構文解析関数 / 文字列化関数を提供します。デフォルトを上書きします。 diff --git a/docs/ja/api/router-instance.md b/docs/ja/api/router-instance.md index 8aac77279..02ace70f8 100644 --- a/docs/ja/api/router-instance.md +++ b/docs/ja/api/router-instance.md @@ -68,16 +68,16 @@ これは、サーバーとクライアントの両方で一貫した出力を保証するために、サーバーサイドレンダリングに役立ちます。 - The second argument `errorCallback` is only supported in 2.4+. It will be called when the initial route resolution runs into an error (e.g. failed to resolve an async component). + 第 2 引数 `errorCallback` は 2.4 以降でのみサポートされます。初期ルート解決がエラーの時に、呼び出されます (例: 非同期コンポーネントの解決が失敗)。 - **router.onError(callback)** > 2.4.0+ - Register a callback which will be called when an error is caught during a route navigation. Note for an error to be called, it must be one of the following scenarios: + ルートナビゲーション中にエラーが検出されたときに呼び出されるコールバックを登録します。エラーを呼び出すには、次のいずれかのシナリオが必要であることに注意してください: - - The error is thrown synchronously inside a route guard function; + - エラーがルートガード関数内で同期的に投げられる; - - The error is caught and asynchronously handled by calling `next(err)` inside a route guard function; + - エラーが補足され、ルートガード関数内で `next(err)` を呼び出すことによって非同期に処理される; - - An error occurred when trying to resolve an async component that is required to render a route. + - ルートを描画するために必須な非同期コンポーネントを解決しようとする時に発生したエラー; From 6866498020ffcb04919d44092626d6b5090f510b Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Tue, 11 Apr 2017 01:36:21 +0900 Subject: [PATCH 8/8] fix translation --- docs/ja/essentials/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ja/essentials/navigation.md b/docs/ja/essentials/navigation.md index dcacefffc..7c69d94b2 100644 --- a/docs/ja/essentials/navigation.md +++ b/docs/ja/essentials/navigation.md @@ -4,7 +4,7 @@ #### `router.push(location, onComplete?, onAbort?)` -**注意: Vue インスタンスの内部では、`$router` としてルーターインスタンスにアクセスする必要があります。従って、`this.$router.push` で呼ぶことができます。** +**注意: Vue インスタンスの内部では、`$router` としてルーターインスタンスにアクセスできます。従って、`this.$router.push` で呼ぶことができます。** 異なる URL へ遷移するときに `router.push` が使えます。このメソッドは history スタックに新しいエントリを追加します。それによってユーザーがブラウザの戻るボタンをクリックした時に前の URL に戻れるようになります。