Skip to content

Commit ef73018

Browse files
committed
setup translation for japanese
1 parent 2293857 commit ef73018

35 files changed

+1001
-0
lines changed

docs/LANGS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [日本語](ja/)

docs/ja/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUMMARY.md

docs/ja/SUMMARY.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# vue-router documentation [![npm package](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router)
2+
3+
- [Installation](installation.md)
4+
- [Basic Usage](basic.md)
5+
- [Nested Routes](nested.md)
6+
- [Route Object & Route Matching](route.md)
7+
- [Router Options](options.md)
8+
- [router-view](view.md)
9+
- [v-link](link.md)
10+
- [Transition Pipeline](pipeline/README.md)
11+
- [Transition Hooks](pipeline/hooks.md)
12+
- [data](pipeline/data.md)
13+
- [activate](pipeline/activate.md)
14+
- [deactivate](pipeline/deactivate.md)
15+
- [canActivate](pipeline/can-activate.md)
16+
- [canDeactivate](pipeline/can-deactivate.md)
17+
- [canReuse](pipeline/can-reuse.md)
18+
- [API Reference](api/README.md)
19+
- [Router instance properties](api/properties.md)
20+
- [router.start](api/start.md)
21+
- [router.stop](api/stop.md)
22+
- [router.map](api/map.md)
23+
- [router.on](api/on.md)
24+
- [router.go](api/go.md)
25+
- [router.replace](api/replace.md)
26+
- [router.redirect](api/redirect.md)
27+
- [router.alias](api/alias.md)
28+
- [router.beforeEach](api/before-each.md)
29+
- [router.afterEach](api/after-each.md)

docs/ja/api/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# API Reference
2+
3+
- [Router instance properties](properties.md)
4+
- [router.start](start.md)
5+
- [router.stop](stop.md)
6+
- [router.map](map.md)
7+
- [router.on](on.md)
8+
- [router.go](go.md)
9+
- [router.replace](replace.md)
10+
- [router.redirect](redirect.md)
11+
- [router.alias](alias.md)
12+
- [router.beforeEach](before-each.md)
13+
- [router.afterEach](after-each.md)

docs/ja/api/after-each.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# `router.afterEach(hook)`
2+
3+
Set the global after hook, which will be called every time when a route transition successfully **enters the activation phase**.
4+
5+
Note this hook being called only means the transition has been validated, i.e. all `canDeactivate` and `canActivate` hooks have successfully resolved and the browser URL has been updated. It does not guarantee that all `activate` hooks have been resolved.
6+
7+
You can only have one global after hook at a time; however you can implement your own middleware system inside this hook.
8+
9+
### Arguments
10+
11+
- `hook {Function}`
12+
13+
The hook function receives a single argument which is a [Transition Object](../pipeline/hooks.html#transition-object), but you can only access its `to` and `from` properties, which are route objects. You **cannot** call transition methods in the global after hook.
14+
15+
### Example
16+
17+
``` js
18+
router.afterEach(function (transition) {
19+
console.log('Successfully navigated to: ' + transition.to.path)
20+
})
21+
```

docs/ja/api/alias.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# `router.alias(aliasMap)`
2+
3+
Configures global alias rules for the router. The difference between alias and redirect is that instead of replacing the `fromPath` with `toPath`, an alias will preserve `fromPath` while matching it as `toPath`.
4+
5+
For example, if we alias `/a` to `/a/b/c`, when we visit `/a`, the browser URL will display `/a`. However, the router will match the path as if we are visiting `/a/b/c` instead.
6+
7+
### Arguments
8+
9+
- `aliasMap {Object}`
10+
11+
The alias map object should be in the form of { fromPath: toPath, ... }. The paths can contain dynamic segments.
12+
13+
### Example
14+
15+
``` js
16+
router.alias({
17+
18+
// match /a as if it is /a/b/c
19+
'/a': '/a/b/c',
20+
21+
// alias can contian dynamic segments
22+
// the dynamic segment names must match
23+
'/user/:userId': '/user/profile/:userId'
24+
})
25+
```

docs/ja/api/before-each.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# `router.beforeEach(hook)`
2+
3+
Set the global before hook, which will be called before every route transition starts. This is before the entire transition pipeline; if the hook rejects the transition, the pipeline won't even be started.
4+
5+
Note you can only have one global before hook at a time; however you can implement your own middleware system inside this hook.
6+
7+
### Arguments
8+
9+
- `hook {Function}`
10+
11+
The hook function receives a single argument which is a [Transition Object](../pipeline/hooks.html#transition-object).
12+
13+
### Example
14+
15+
Basic
16+
17+
``` js
18+
router.beforeEach(function (transition) {
19+
if (transition.to.path === '/forbidden') {
20+
transition.abort()
21+
} else {
22+
transition.next()
23+
}
24+
})
25+
```
26+
27+
Promise + ES6
28+
29+
``` js
30+
router.beforeEach(function ({ to, next }) {
31+
if (to.path === '/auth-required') {
32+
// return a Promise that resolves to true or false
33+
return AuthService.isLoggedIn()
34+
} else {
35+
next()
36+
}
37+
})
38+
```

docs/ja/api/go.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `router.go(path)`
2+
3+
Programatically navigate to a new route.
4+
5+
### Arguments
6+
7+
- `path: String`
8+
9+
The path must be a plain path (i.e. no dynamic segments or star segments). The the path doesn't start with `/`, it will be resolved relative to the current active path.

docs/ja/api/map.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# `router.map(routeMap)`
2+
3+
The main method to define route mappings for the router.
4+
5+
### Arguments
6+
7+
- `routeMap: Object`
8+
9+
An object whose keys are paths and values are route config objects. For path matching rules, see [Route Matching](../route.html#route-matching).
10+
11+
### Route Config Object
12+
13+
A route config object can contain two fields:
14+
15+
- `component`: The Vue component to render into the top-level `<router-view>` outlet when this path is matched. The value could either be a constructor returned by calling `Vue.extend`, or a plain component options object. In the latter case the router will implicitly call `Vue.extend` for you.
16+
17+
- `subRoutes`: You can nest another sub route-map here. For each sub path in the `routeRoutes` map, the router will match it against the full path by appending it to the parent path. The matched component will be rendered into the parent route component's `<router-view>` outlet.
18+
19+
### Example
20+
21+
``` js
22+
router.map({
23+
// component constructor
24+
'/a': {
25+
component: Vue.extend({ /* ... */ })
26+
},
27+
// plain component options object
28+
'/b': {
29+
component: {
30+
template: '<p>Hello from /b</p>'
31+
}
32+
},
33+
// nested routes
34+
'/c': {
35+
component: {
36+
// simply render the child view
37+
template: '<router-view></router-view>'
38+
},
39+
subRoutes: {
40+
// rendered when the path is /c/d
41+
'/d': { component: { template: 'D' }},
42+
// rendered when the path is /c/e
43+
'/e': { component: { template: 'E' }}
44+
}
45+
}
46+
})
47+
```

docs/ja/api/on.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `router.on(path, config)`
2+
3+
Add a single root-level route configuration. Internally, `router.map()` simply calls `router.on()` for each key-value pair in the router map object it receives.
4+
5+
### Arguments
6+
7+
- `path: String` - see [Route Matching](../route.md#route-matching)
8+
- `config: Object` - see [Route Config Object](map.md#route-config-object).
9+
10+
### Example
11+
12+
``` js
13+
router.on('/user/:userId', {
14+
component: {
15+
template: '<div>{{$route.params.userId}}</div>'
16+
}
17+
})
18+
```

0 commit comments

Comments
 (0)