+
+```
+
+To see an example, take a look at the [nested-routes example](/examples/nested-routes).
diff --git a/ja/api/components-nuxt-link.md b/ja/api/components-nuxt-link.md
new file mode 100644
index 000000000..910a18504
--- /dev/null
+++ b/ja/api/components-nuxt-link.md
@@ -0,0 +1,23 @@
+---
+title: "API: The Component"
+description: Link the pages between them with nuxt-link.
+---
+
+# The <nuxt-link> Component
+
+> This component is used to link the page components between them.
+
+At the moment, `` is the same as [``](https://router.vuejs.org/en/api/router-link.html), so we recommend you to see how to use it on the [vue-router documentation](https://router.vuejs.org/en/api/router-link.html).
+
+Example (`pages/index.vue`):
+
+```html
+
+
+
Home page
+ About
+
+
+```
+
+In the future, we will add features to the nuxt-link component, like pre-fetching on the background for improving the responsiveness of nuxt.js applications.
diff --git a/ja/api/components-nuxt.md b/ja/api/components-nuxt.md
new file mode 100644
index 000000000..7f1f0a7aa
--- /dev/null
+++ b/ja/api/components-nuxt.md
@@ -0,0 +1,22 @@
+---
+title: "API: The Component"
+description: Display the page components inside a layout.
+---
+
+# The <nuxt> Component
+
+> This component is used only in [layouts](/guide/views#layouts) to display the page components.
+
+Example (`layouts/default.vue`):
+
+```html
+
+
+
My nav bar
+
+
My footer
+
+
+```
+
+To see an example, take a look at the [layouts example](/examples/layouts).
diff --git a/ja/api/configuration-build.md b/ja/api/configuration-build.md
new file mode 100644
index 000000000..a80297d1f
--- /dev/null
+++ b/ja/api/configuration-build.md
@@ -0,0 +1,248 @@
+---
+title: "API: The build Property"
+description: Nuxt.js lets you customize the webpack configuration for building your web application as you want.
+---
+
+# The build Property
+
+> Nuxt.js lets you customize the webpack configuration for building your web application as you want.
+
+## analyze
+
+> Nuxt.js use [webpack-bundle-analyzer](https://github.com/th0r/webpack-bundle-analyzer) to let you visualize your bundles and how to optimize them.
+
+- Type: `Boolean` or `Object`
+- Default: `false`
+
+If an object, see available properties [here](https://github.com/th0r/webpack-bundle-analyzer#as-plugin).
+
+Example (`nuxt.config.js`):
+```js
+module.exports = {
+ build: {
+ analyze: true
+ // or
+ analyze: {
+ analyzerMode: 'static'
+ }
+ }
+}
+```
+
+
**INFO:** You can use the command `nuxt build --analyzer` or `nuxt build -a` to build your application and launch the bundle analyzer on [http://localhost:8888](http://localhost:8888)
When the loaders are defined in the `nuxt.config.js`, the default loaders will be overwritten.
+
+## plugins
+
+- Type: `Array`
+- Default: `[]`
+
+> Add Webpack plugins
+
+Example (`nuxt.config.js`):
+```js
+const webpack = require('webpack')
+
+module.exports = {
+ build: {
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.VERSION': require('./package.json').version
+ })
+ ]
+ }
+}
+```
+
+## postcss
+
+- **Type:** `Array`
+
+> Customize [postcss](https://github.com/postcss/postcss) options
+
+Default:
+```js
+[
+ require('autoprefixer')({
+ browsers: ['last 3 versions']
+ })
+]
+```
+
+Example (`nuxt.config.js`):
+```js
+module.exports = {
+ build: {
+ postcss: [
+ require('postcss-nested')(),
+ require('postcss-responsive-type')(),
+ require('postcss-hexrgba')(),
+ require('autoprefixer')({
+ browsers: ['last 3 versions']
+ })
+ ]
+ }
+}
+```
+
+## vendor
+
+> Nuxt.js lets you add modules inside the `vendor.bundle.js` file generated to reduce the size of the app bundle. It's really useful when using external modules (like `axios` for example)
+
+- **Type:** `Array`
+ - **Items:** `String`
+
+To add a module/file inside the vendor bundle, add the `build.vendor` key inside `nuxt.config.js`:
+
+```js
+module.exports = {
+ build: {
+ vendor: ['axios']
+ }
+}
+```
+
+You can also give a path to a file, like a custom lib you created:
+```js
+module.exports = {
+ build: {
+ vendor: [
+ 'axios',
+ '~plugins/my-lib.js'
+ ]
+ }
+}
+```
diff --git a/ja/api/configuration-cache.md b/ja/api/configuration-cache.md
new file mode 100644
index 000000000..5db7a1db0
--- /dev/null
+++ b/ja/api/configuration-cache.md
@@ -0,0 +1,33 @@
+---
+title: "API: The cache Property"
+description: Nuxt.js use lru-cache to allow cached components for better render performances
+---
+
+# The cache Property
+
+> Nuxt.js use [lru-cache](https://github.com/isaacs/node-lru-cache) to allow cached components for better render performances
+
+## Usage
+
+- **Type:** `Boolean` or `Object` (Default: `false`)
+
+If an object, see [lru-cache options](https://github.com/isaacs/node-lru-cache#options).
+
+Use the `cache` key in your `nuxt.config.js`:
+```js
+module.exports = {
+ cache: true
+ // or
+ cache: {
+ max: 1000,
+ maxAge: 900000
+ }
+}
+```
+
+If `cache` is set to `true` the default keys given are:
+
+| key | Optional? | Type | Default | definition |
+|------|------------|-----|---------|------------|
+| `max` | Optional | Integer | 1000 | The maximum size of the cached components, when the 1001 is added, the first one added will be removed from the cache to let space for the new one. |
+| `maxAge` | Optional | Integer | 900000 | Maximum age in ms, default to 15 minutes. |
diff --git a/ja/api/configuration-css.md b/ja/api/configuration-css.md
new file mode 100644
index 000000000..8abd539fc
--- /dev/null
+++ b/ja/api/configuration-css.md
@@ -0,0 +1,32 @@
+---
+title: "API: The css Property"
+description: Nuxt.js lets you define the CSS files/modules/libraries you want to set globally (included in every pages).
+---
+
+# The css Property
+
+> Nuxt.js lets you define the CSS files/modules/libraries you want to set globally (included in every pages).
+
+- **Type:** `Array`
+ - **Items:** `String` or `Object`
+
+If the item is an object, the properties are:
+- src: `String` (path of the file)
+- lang: `String` ([pre-processor used](/guide/pages#using-pre-processors))
+
+In `nuxt.config.js`, add the CSS resources:
+
+```js
+module.exports = {
+ css: [
+ // Load a node.js module
+ 'hover.css/css/hover-min.css',
+ // node.js module but we specify the pre-processor
+ { src: 'bulma', lang: 'sass' },
+ // Css file in the project
+ '~assets/css/main.css'
+ ]
+}
+```
+
+
**In production**, all CSS will be minified and extracted in a file named `styles.css` and added in the `
` of the page.
diff --git a/ja/api/configuration-dev.md b/ja/api/configuration-dev.md
new file mode 100644
index 000000000..a913984a0
--- /dev/null
+++ b/ja/api/configuration-dev.md
@@ -0,0 +1,62 @@
+---
+title: "API: The dev Property"
+description: Define the development or production mode.
+---
+
+# The dev Property
+
+- Type: `Boolean`
+- Default: `true`
+
+> Define the development or production mode of nuxt.js
+
+This property is overwritten by [nuxt commands](/guide/commands):
+- `dev` is forced to `true` with `nuxt`
+- `dev` is force to `false` with `nuxt build`, `nuxt start` and `nuxt generate`
+
+This property should be used when using [nuxt.js programmatically](/api/nuxt):
+
+Example:
+
+`nuxt.config.js`
+```js
+module.exports = {
+ dev: (process.env.NODE_ENV !== 'production')
+}
+```
+
+`server.js`
+```js
+const Nuxt = require('nuxt')
+const app = require('express')()
+const port = process.env.PORT || 3000
+
+// We instantiate Nuxt.js with the options
+let config = require('./nuxt.config.js')
+const nuxt = new Nuxt(config)
+app.use(nuxt.render)
+
+// Build only in dev mode
+if (config.dev) {
+ nuxt.build()
+ .catch((error) => {
+ console.error(error)
+ process.exit(1)
+ })
+}
+
+// Listen the server
+app.listen(port, '0.0.0.0')
+console.log('Server listening on localhost:' + port)
+```
+
+Then in your `package.json`:
+```json
+{
+ "scripts": {
+ "dev": "node server.js",
+ "build": "nuxt build",
+ "start": "NODE_ENV=production node server.js"
+ }
+}
+```
diff --git a/ja/api/configuration-env.md b/ja/api/configuration-env.md
new file mode 100644
index 000000000..12765e988
--- /dev/null
+++ b/ja/api/configuration-env.md
@@ -0,0 +1,41 @@
+---
+title: "API: The env Property"
+description: Share environment variables between client and server.
+---
+
+# The env Property
+
+- Type: `Object`
+
+> Nuxt.js lets you create environment variables that will be shared for the client and server-side.
+
+Example (`nuxt.config.js`):
+
+```js
+module.exports = {
+ env: {
+ baseUrl: process.env.BASE_URL || 'http://localhost:3000'
+ }
+}
+```
+
+This lets me create a `baseUrl` property that will be equal to the `BASE_URL` environment variable if defined, otherwise, equal to `http://localhost:3000`.
+
+Then, I can access my `baseUrl` variable with 2 ways:
+1. Via `process.env.baseUrl`
+2. Via `context.baseUrl`, see [context api](/api#context)
+
+You can use the `env` property for giving public token for example.
+
+For the example above, we can use it to configure [axios](https://github.com/mzabriskie/axios).
+
+`plugins/axios.js`:
+```js
+import axios from 'axios'
+
+export default axios.create({
+ baseURL: process.env.baseUrl
+})
+```
+
+Then, in your pages, you can import axios like this: `import axios from '~plugins/axios'`
diff --git a/ja/api/configuration-generate.md b/ja/api/configuration-generate.md
new file mode 100644
index 000000000..1e3886819
--- /dev/null
+++ b/ja/api/configuration-generate.md
@@ -0,0 +1,125 @@
+---
+title: "API: The generate Property"
+description: Configure the generation of your universal web application to a static web application.
+---
+
+# The generate Property
+
+- Type: `Object`
+
+> Configure the generation of your universal web application to a static web application.
+
+When launching `nuxt generate` or calling `nuxt.generate()`, nuxt.js will use the configuration defined in the `generate` property.
+
+## dir
+
+- Type: 'Sring'
+- Default: `'dist'`
+
+Directory name created by `nuxt generate`.
+
+## routeParams
+
+- Type: `Object`
+ - Key: `String` (route path)
+ - Value: `Array` or `Function`
+
+When using [dynamic routes](/guide/routing#dynamic-routes), you need to define a mapping of params for each dynamic route to generate.
+
+Example:
+
+```bash
+-| pages/
+---| index.vue
+---| users/
+-----| _id.vue
+```
+
+The routes generated by nuxt.js are `/` and `/users/:id`.
+
+If you try to launch `nuxt generate`, the terminal will exit with an error:
+
+```bash
+Could not generate the dynamic route /users/:id, please add the mapping params in nuxt.config.js (generate.routeParams).
+```
+
+We add the mapping for `/users/:id` in `nuxt.config.js`:
+```js
+module.exports = {
+ generate: {
+ routeParams: {
+ '/users/:id': [
+ { id: 1 },
+ { id: 2 },
+ { id: 3 }
+ ]
+ }
+ }
+}
+```
+
+Then when we launch `nuxt generate`:
+```bash
+[nuxt] Generating...
+[...]
+nuxt:render Rendering url / +154ms
+nuxt:render Rendering url /users/1 +12ms
+nuxt:render Rendering url /users/2 +33ms
+nuxt:render Rendering url /users/3 +7ms
+nuxt:generate Generate file: /index.html +21ms
+nuxt:generate Generate file: /users/1/index.html +31ms
+nuxt:generate Generate file: /users/2/index.html +15ms
+nuxt:generate Generate file: /users/3/index.html +23ms
+nuxt:generate HTML Files generated in 7.6s +6ms
+[nuxt] Generate done
+```
+
+Great, but what if we have **dynamic params**?
+1. Use a `Function` which returns a `Promise`
+2. Use a `Function` with a callback(err, params)
+
+### Function which returns a Promise
+
+`nuxt.config.js`
+```js
+import axios from 'axios'
+
+module.exports = {
+ generate: {
+ routeParams: {
+ '/users/:id': function () {
+ return axios.get('https://my-api/users')
+ .then((res) => {
+ return res.data.map((user) => {
+ return { id: user.id }
+ })
+ })
+ }
+ }
+ }
+}
+```
+
+## Function with a callback
+
+`nuxt.config.js`
+```js
+import axios from 'axios'
+
+module.exports = {
+ generate: {
+ routeParams: {
+ '/users/:id': function (callback) {
+ axios.get('https://my-api/users')
+ .then((res) => {
+ var params = res.data.map((user) => {
+ return { id: user.id }
+ })
+ callback(null, params)
+ })
+ .catch(callback)
+ }
+ }
+ }
+}
+```
diff --git a/ja/api/configuration-head.md b/ja/api/configuration-head.md
new file mode 100644
index 000000000..3c8e71286
--- /dev/null
+++ b/ja/api/configuration-head.md
@@ -0,0 +1,27 @@
+---
+title: "API: The head Property"
+description: Nuxt.js let you define all default meta for your application inside nuxt.config.js.
+---
+
+# The head Property
+
+> Nuxt.js let you define all default meta for your application inside `nuxt.config.js`, use the same `head` property:
+
+- **Type:** `Object`
+
+```js
+module.exports = {
+ head: {
+ titleTemplate: '%s - Nuxt.js',
+ meta: [
+ { charset: 'utf-8' },
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
+ { hid: 'description', name: 'description', content: 'Meta description' }
+ ]
+ }
+}
+```
+
+To know the list of options you can give to `head`, take a look at [vue-meta documentation](https://github.com/declandewet/vue-meta#recognized-metainfo-properties).
+
+
INFO: You can also use `head` in the page components and access to the component data through `this`, see [component head property](/api/pages-head).
diff --git a/ja/api/configuration-loading.md b/ja/api/configuration-loading.md
new file mode 100644
index 000000000..a1276936a
--- /dev/null
+++ b/ja/api/configuration-loading.md
@@ -0,0 +1,109 @@
+---
+title: "API: The loading Property"
+description: Nuxt.js uses it's own component to show a progress bar between the routes. You can customize it, disable it or create your own component.
+---
+
+# The loading Property
+
+- Type: `Boolean` or `Object` or `String`
+
+> Nuxt.js uses it's own component to show a progress bar between the routes. You can customize it, disable it or create your own component.
+
+## Disable the Progress Bar
+
+- Type: `Boolean`
+
+If you don't want to display the progress bar between the routes, simply add `loading: false` in your `nuxt.config.js` file:
+
+```js
+module.exports = {
+ loading: false
+}
+```
+
+## Customize the Progress Bar
+
+- Type: `Object`
+
+List of properties to customize the progress bar.
+
+| Key | Type | Default | Description |
+|-----|------|---------|-------------|
+| `color` | String | `'black'` | CSS color of the progress bar |
+| `failedColor` | String | `'red'` | CSS color of the progress bar when an error appended while rendering the route (if `data` or `fetch` sent back an error for example). |
+| `height` | String | `'2px'` | Height of the progress bar (used in the `style` property of the progress bar) |
+| `duration` | Number | `5000` | In ms, the maximum duration of the progress bar, Nuxt.js assumes that the route will be rendered before 5 seconds. |
+
+For a blue progress bar with 5px of height, we update the `nuxt.config.js` to the following:
+
+```js
+module.exports = {
+ loading: {
+ color: 'blue',
+ height: '5px'
+ }
+}
+```
+
+## Use a Custom Loading Component
+
+- Type: `String`
+
+You can create your own component that Nuxt.js will call instead of its default component. To do so, you need to give a path to your component in the `loading` option. Then, your component will be called directly by Nuxt.js.
+
+**Your component has to expose some of theses methods:**
+
+| Method | Required | Description |
+|--------|----------|-------------|
+| `start()` | Required | Called when a route changes, this is here where you display your component. |
+| `finish()` | Required | Called when a route is loaded (and data fetched), this is here where you hide your component. |
+| `fail()` | *Optional* | Called when a route couldn't be loaded (failed to fetch data for example). |
+| `increase(num)` | *Optional* | Called during loading the route component, `num` is an Integer < 100. |
+
+We can create our custom component in `components/loading.vue`:
+```html
+
+
+
Loading...
+
+
+
+
+
+
+```
+
+Then, we update our `nuxt.config.js` to tell Nuxt.js to use our component:
+
+```js
+module.exports = {
+ loading: '~components/loading.vue'
+}
+```
diff --git a/ja/api/configuration-plugins.md b/ja/api/configuration-plugins.md
new file mode 100644
index 000000000..6998e0082
--- /dev/null
+++ b/ja/api/configuration-plugins.md
@@ -0,0 +1,32 @@
+---
+title: "API: The plugins Property"
+description: Use vue.js plugins with the plugins option of nuxt.js.
+---
+
+# The plugins Property
+
+- Type: `Array`
+ - Items: `String`
+
+> The plugins property lets you add vue.js plugins easily to your main application.
+
+Example (`nuxt.config.js`):
+```js
+module.exports = {
+ plugins: ['~plugins/vue-notifications']
+}
+```
+
+Then, we need to create a file in `plugins/vue-notifications.js`:
+```js
+import Vue from 'vue'
+import VueNotifications from 'vue-notifications'
+
+Vue.use(VueNotifications)
+```
+
+All the paths defined in the `plugins` property will be **imported** before initializing the main application.
+
+Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to `plugins` in `nuxt.config.js`.
+
+To learn more how to use the plugins, see the [guide documentation](/guide/plugins#vue-plugins).
diff --git a/ja/api/configuration-rootdir.md b/ja/api/configuration-rootdir.md
new file mode 100644
index 000000000..f4570d221
--- /dev/null
+++ b/ja/api/configuration-rootdir.md
@@ -0,0 +1,17 @@
+---
+title: "API: The rootDir Property"
+description: Define the workspace of nuxt.js application
+---
+
+# The rootDir Property
+
+- Type: `String`
+- Default: `process.cwd()`
+
+> Define the workspace of your nuxt.js application.
+
+This property is overwritten by [nuxt commands](/guide/commands) and set to the argument of the command (example: `nuxt my-app/` will set the `rootDir` to `my-app/` with its absolute path).
+
+This property should be used when using [nuxt.js programmatically](/api/nuxt).
+
+
The downside of this option is that your `node_modules` directory should be inside the `rootDir` folder. If you want to set the path of the application without the node_modules, use the [`srcDir` option](/api/configuration-srcdir).
diff --git a/ja/api/configuration-router.md b/ja/api/configuration-router.md
new file mode 100644
index 000000000..a95817023
--- /dev/null
+++ b/ja/api/configuration-router.md
@@ -0,0 +1,149 @@
+---
+title: "API: The router Property"
+description: The router property lets you customize nuxt.js router.
+---
+
+# The router Property
+
+> The router property lets you customize nuxt.js router ([vue-router](https://router.vuejs.org/en/)).
+
+## base
+
+- Type: `String`
+- Default: `'/'`
+
+The base URL of the app. For example, if the entire single page application is served under `/app/`, then base should use the value `'/app/'`.
+
+Example (`nuxt.config.js`):
+```js
+module.exports = {
+ router: {
+ base: '/app/'
+ }
+}
+```
+
+
When `base` is set, nuxt.js will also add in the document header ``.
+
+> This option is given directly to the vue-router [Router constructor](https://router.vuejs.org/en/api/options.html).
+
+## linkActiveClass
+
+- Type: `String`
+- Default: `'nuxt-link-active'`
+
+Globally configure [``](/api/components-nuxt-link) default active class.
+
+Example (`nuxt.config.js`):
+```js
+module.exports = {
+ router: {
+ linkActiveClass: 'active-link'
+ }
+}
+```
+
+> This option is given directly to the [vue-router Router constructor](https://router.vuejs.org/en/api/options.html).
+
+## scrollBehavior
+
+- Type: `Function`
+
+The `scrollBehavior` option lets you define a custom behavior for the scroll position between the routes. This method is called every time a page is rendered.
+
+By default, the scrollBehavior option is set to:
+```js
+const scrollBehavior = (to, from, savedPosition) => {
+ // savedPosition is only available for popstate navigations.
+ if (savedPosition) {
+ return savedPosition
+ } else {
+ let position = {}
+ // if no children detected
+ if (to.matched.length < 2) {
+ // scroll to the top of the page
+ position = { x: 0, y: 0 }
+ }
+ else if (to.matched.some((r) => r.components.default.options.scrollToTop)) {
+ // if one of the children has scrollToTop option set to true
+ position = { x: 0, y: 0 }
+ }
+ // if link has anchor, scroll to anchor by returning the selector
+ if (to.hash) {
+ position = { selector: to.hash }
+ }
+ return position
+ }
+}
+```
+
+Example of forcing the scroll position to the top for every routes:
+
+`nuxt.config.js`
+```js
+module.exports = {
+ router: {
+ scrollBehavior: function (to, from, savedPosition) {
+ return { x: 0, y: 0 }
+ }
+ }
+}
+```
+
+> This option is given directly to the vue-router [Router constructor](https://router.vuejs.org/en/api/options.html).
+
+## middleware
+
+- Type: `String` or `Array`
+ - Items: `String`
+
+Set the default(s) middleware for every pages of the application.
+
+Example:
+
+`nuxt.config.js`
+```js
+module.exports = {
+ router: {
+ // Run the middleware/user-agent.js on every pages
+ middleware: 'user-agent'
+ }
+}
+```
+
+`middleware/user-agent.js`
+```js
+export default function (context) {
+ // Add the userAgent property in the context (available in `data` and `fetch`)
+ context.userAgent = context.isServer ? context.req.headers['user-agent'] : navigator.userAgent
+}
+```
+
+To learn more about the middleware, see the [middleware guide](/guide/routing#middleware).
+
+## extendRoutes
+
+- Type: `Function`
+
+You may want to extend the routes created by nuxt.js. You can do it via the `extendRoutes` option.
+
+Example of adding a custom route:
+
+`nuxt.config.js`
+```js
+const resolve = require('path').resolve
+
+module.exports = {
+ router: {
+ extendRoutes (routes) {
+ routes.push({
+ name: 'custom',
+ path: '*',
+ component: resolve(__dirname, 'pages/404.vue')
+ })
+ }
+ }
+}
+```
+
+The schema of the route should respect the [vue-router](https://router.vuejs.org/en/) schema.
diff --git a/ja/api/configuration-srcdir.md b/ja/api/configuration-srcdir.md
new file mode 100644
index 000000000..9b23566d0
--- /dev/null
+++ b/ja/api/configuration-srcdir.md
@@ -0,0 +1,32 @@
+---
+title: "API: The srcDir Property"
+description: Define the source directory of your nuxt.js application
+---
+
+# The srcDir Property
+
+- Type: `String`
+- Default: [rootDir value](/api/configuration-rootdir)
+
+> Define the source directory of your nuxt.js application
+
+Example (`nuxt.config.js`):
+
+```js
+module.exports = {
+ srcDir: 'client/'
+}
+```
+
+Then, your application structure can be:
+```bash
+-| app/
+---| node_modules/
+---| client/
+------| pages/
+------| components/
+---| nuxt.config.js
+---| package.json
+```
+
+This option is useful to have a custom server and using nuxt.js, so all npm dependencies can be regrouped in one `package.json`.
diff --git a/ja/api/configuration-transition.md b/ja/api/configuration-transition.md
new file mode 100644
index 000000000..9fa7efc79
--- /dev/null
+++ b/ja/api/configuration-transition.md
@@ -0,0 +1,36 @@
+---
+title: "API: The transition Property"
+description: Set the default properties of the pages transitions.
+---
+
+# The transition Property
+
+- Type: `String` or `Object`
+
+> Used to set the default properties of the pages transitions.
+
+Default:
+```js
+{
+ name: 'page',
+ mode: 'out-in'
+}
+```
+
+Example (`nuxt.config.js`):
+
+```js
+module.exports = {
+ transition: 'page'
+ // or
+ transition: {
+ name: 'page',
+ mode: 'out-in',
+ beforeEnter (el) {
+ console.log('Before enter...');
+ }
+ }
+}
+```
+
+The transition key in `nuxt.config.js` is used to set the default properties for the pages transitions. To learn more about the available keys when the `transition` key is an object, see the [pages transition property](/api/pages-transition#object).
diff --git a/ja/api/index.md b/ja/api/index.md
new file mode 100644
index 000000000..4fb78c6f5
--- /dev/null
+++ b/ja/api/index.md
@@ -0,0 +1,41 @@
+---
+title: "API: The data Method"
+description: Nuxt.js supercharges the data method from vue.js to let you handle async operation before setting the component data.
+---
+
+# The data Method
+
+> Nuxt.js *supercharges* the `data` method from vue.js to let you handle async operation before setting the component data.
+
+- **Type:** `Function`
+
+`data` is called every time before loading the component (**only for pages components**). It can be called from the server-side or before navigating to the corresponding route. This method receives the **context** as the first argument, you can use it to fetch some data and return the component data.
+
+```js
+export default {
+ data (context) {
+ return { foo: 'bar' }
+ }
+}
+```
+
+
You do **NOT** have access of the component instance through `this` inside `data` because it is called **before initiating** the component.
+
+## Context
+
+List of all the available keys in `context`:
+
+| Key | Type | Available | Description |
+|-----|------|--------------|-------------|
+| `isClient` | Boolean | Client & Server | Boolean to let you know if you're actually renderer from the client-side |
+| `isServer` | Boolean | Client & Server | Boolean to let you know if you're actually renderer from the server-side |
+| `isDev` | Boolean | Client & Server | Boolean to let you know if you're in dev mode, can be useful for caching some data in production |
+| `route` | [vue-router route](https://router.vuejs.org/en/api/route-object.html) | Client & Server | `vue-router` route instance. |
+| `store` | [vuex store](http://vuex.vuejs.org/en/api.html#vuexstore-instance-properties) | Client & Server | `Vuex.Store` instance. **Available only if the [vuex store](/guide/vuex-store) is set.** |
+| `env` | Object | Client & Server | Environment variables set in `nuxt.config.js`, see [env api](/api/configuration-env) |
+| `params` | Object | Client & Server | Alias of route.params |
+| `query` | Object | Client & Server | Alias of route.query |
+| `req` | [http.Request](https://nodejs.org/api/http.html#http_class_http_incomingmessage) | Server | Request from the node.js server. If nuxt is used as a middleware, the req object might be different depending of the framework you're using. *Not available via `nuxt generate`*. |
+| `res` | [http.Response](https://nodejs.org/api/http.html#http_class_http_serverresponse) | Server | Response from the node.js server. If nuxt is used as a middleware, the res object might be different depending of the framework you're using. *Not available via `nuxt generate`*. |
+| `redirect` | Function | Client & Server | Use this method to redirect the user to another route, the status code is used on the server-side, default to 302. `redirect([status,] path [, query])` |
+| `error` | Function | Client & Server | Use this method to show the error page: `error(params)`. The `params` should have the fields `statusCode` and `message`. |
diff --git a/ja/api/menu.json b/ja/api/menu.json
new file mode 100644
index 000000000..e32f0ff0f
--- /dev/null
+++ b/ja/api/menu.json
@@ -0,0 +1,95 @@
+[
+ {
+ "title": "Pages",
+ "links": [
+ { "name": "data", "to": "/" },
+ { "name": "fetch", "to": "/pages-fetch" },
+ { "name": "head", "to": "/pages-head" },
+ { "name": "layout", "to": "/pages-layout" },
+ { "name": "middleware", "to": "/pages-middleware" },
+ { "name": "scrollToTop", "to": "/pages-scrolltotop" },
+ {
+ "name": "transition", "to": "/pages-transition",
+ "contents": [
+ { "name": "String", "to": "#string" },
+ { "name": "Object", "to": "#object" },
+ { "name": "Function", "to": "#function" }
+ ]
+ },
+ { "name": "validate", "to": "/pages-validate" }
+ ]
+ },
+ {
+ "title": "Components",
+ "links": [
+ { "name": "nuxt", "to": "/components-nuxt" },
+ { "name": "nuxt-child", "to": "/components-nuxt-child" },
+ { "name": "nuxt-link", "to": "/components-nuxt-link" }
+ ]
+ },
+ {
+ "title": "Configuration",
+ "links": [
+ {
+ "name": "build",
+ "to": "/configuration-build",
+ "contents": [
+ { "name": "analyze", "to": "#analyze" },
+ { "name": "babel", "to": "#babel" },
+ { "name": "extend", "to": "#extend" },
+ { "name": "filenames", "to": "#filenames" },
+ { "name": "loaders", "to": "#loaders" },
+ { "name": "plugins", "to": "#plugins" },
+ { "name": "postcss", "to": "#postcss" },
+ { "name": "vendor", "to": "#vendor" }
+ ]
+ },
+ { "name": "cache", "to": "/configuration-cache" },
+ { "name": "css", "to": "/configuration-css" },
+ { "name": "dev", "to": "/configuration-dev" },
+ { "name": "env", "to": "/configuration-env" },
+ {
+ "name": "generate",
+ "to": "/configuration-generate",
+ "contents": [
+ { "name": "dir", "to": "#dir" },
+ { "name": "routeParams", "to": "#routeparams" }
+ ]
+ },
+ { "name": "head", "to": "/configuration-head" },
+ {
+ "name": "loading",
+ "to": "/configuration-loading",
+ "contents": [
+ { "name": "Disable the Progress Bar", "to": "#disable-the-progress-bar" },
+ { "name": "Customize the Progress Bar", "to": "#customize-the-progress-bar" },
+ { "name": "Use a Custom Loading Component", "to": "#use-a-custom-loading-component" }
+ ]
+ },
+ { "name": "plugins", "to": "/configuration-plugins" },
+ { "name": "rootDir", "to": "/configuration-rootdir" },
+ {
+ "name": "router",
+ "to": "/configuration-router",
+ "contents": [
+ { "name": "base", "to": "#base" },
+ { "name": "linkActiveClass", "to": "#linkactiveclass" },
+ { "name": "scrollBehavior", "to": "#scrollbehavior" },
+ { "name": "middleware", "to": "#middleware" },
+ { "name": "extendRoutes", "to": "#extendroutes" }
+ ]
+ },
+ { "name": "srcDir", "to": "/configuration-srcdir" },
+ { "name": "transition", "to": "/configuration-transition" }
+ ]
+ },
+ {
+ "title": "Nuxt Module",
+ "links": [
+ { "name": "Usage", "to": "/nuxt" },
+ { "name": "render", "to": "/nuxt-render" },
+ { "name": "renderRoute", "to": "/nuxt-render-route" },
+ { "name": "renderAndGetWindow", "to": "/nuxt-render-and-get-window" }
+ ]
+ }
+]
diff --git a/ja/api/nuxt-render-and-get-window.md b/ja/api/nuxt-render-and-get-window.md
new file mode 100644
index 000000000..b8c4368f9
--- /dev/null
+++ b/ja/api/nuxt-render-and-get-window.md
@@ -0,0 +1,35 @@
+---
+title: "API: nuxt.renderAndGetWindow(url, options)"
+description: Get the window from a given url of a nuxt.js application.
+---
+
+# nuxt.renderAndGetWindow(url, options = {})
+
+- Type: `Function`
+- Argument: `String`
+ 1. `String`: url to render
+ 2. *Optional*, `Object`: options
+ - virtualConsole: `Boolean` (default: `true`)
+- Returns: `Promise`
+ - Returns: `window`
+
+> Get the window from a given url of a nuxt.js application.
+
+
This method is made for [test purposes](guide/development-tools#end-to-end-testing).
+
+To use this function, you have to install `jsdom`:
+```bash
+npm install --save-dev jsdom
+```
+
+Example:
+```js
+const Nuxt = require('nuxt')
+const nuxt = new Nuxt()
+
+nuxt.renderAndGetWindow('http://localhost:3000')
+.then((window) => {
+ // Display the head
+ console.log(window.document.title)
+})
+```
diff --git a/ja/api/nuxt-render-route.md b/ja/api/nuxt-render-route.md
new file mode 100644
index 000000000..b99091adb
--- /dev/null
+++ b/ja/api/nuxt-render-route.md
@@ -0,0 +1,43 @@
+---
+title: "API: nuxt.renderRoute(route, context)"
+description: Render a specific route with a given context.
+---
+
+# nuxt.renderRoute(route, context = {})
+
+- Type: `Function`
+- Arguments:
+ 1. `String`, route to render
+ 2. *Optional*, `Object`, context given, available keys: `req` & `res`
+- Returns: `Promise`
+ - `html`: `String`
+ - `error`: `null` or `Object`
+ - `redirected`: `false` or `Object`
+
+> Render a specific route with a given context.
+
+This method should be used mostly for [test purposes](guide/development-tools#end-to-end-testing) as well with [nuxt.renderAndGetWindow](/api/nuxt-render-and-get-window).
+
+
`nuxt.renderRoute` should be executed after the build process in production mode (dev: false).
+
+Example:
+```js
+const Nuxt = require('nuxt')
+let config = require('./nuxt.config.js')
+config.dev = false
+const nuxt = new Nuxt(config)
+
+nuxt.build()
+.then(() => {
+ return nuxt.renderRoute('/')
+})
+.then(({ html, error, redirected }) => {
+ // html will be always a string
+
+ // error not null when the error layout is displayed, the error format is:
+ // { statusCode: 500, message: 'My error message' }
+
+ // redirect is not false when redirect() has been used in data() or fetch()
+ // { path: '/other-path', query: {}, status: 302 }
+})
+```
diff --git a/ja/api/nuxt-render.md b/ja/api/nuxt-render.md
new file mode 100644
index 000000000..a3ee5e8eb
--- /dev/null
+++ b/ja/api/nuxt-render.md
@@ -0,0 +1,45 @@
+---
+title: "API: nuxt.render(req, res)"
+description: You can use Nuxt.js as a middleware for your node.js server.
+---
+
+# nuxt.render(req, res)
+
+- Type: `Function`
+- Arguments:
+ 1. [Request](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
+ 2. [Response](https://nodejs.org/api/http.html#http_class_http_serverresponse)
+- Returns: `Promise`
+
+> You can use nuxt.js as a middleware with `nuxt.render` for your node.js server.
+
+Example with [Express.js](https://github.com/expressjs/express):
+```js
+const Nuxt = require('nuxt')
+const app = require('express')()
+const isProd = (process.env.NODE_ENV === 'production')
+const port = process.env.PORT || 3000
+
+// We instantiate buxt.js with the options
+let config = require('./nuxt.config.js')
+config.dev = !isProd
+const nuxt = new Nuxt(config)
+
+// Render every route with nuxt.js
+app.use(nuxt.render)
+
+// Build only in dev mode with hot-reloading
+if (config.dev) {
+ nuxt.build()
+ .catch((error) => {
+ console.error(error)
+ process.exit(1)
+ })
+}
+
+// Listen the server
+app.listen(port, '0.0.0.0')
+console.log('Server listening on localhost:' + port)
+```
+
+
It's recommended to call **nuxt.render** at the end of your middlewares since it will handle the rendering of your web application and won't call next()
diff --git a/ja/api/nuxt.md b/ja/api/nuxt.md
new file mode 100644
index 000000000..4ff4de310
--- /dev/null
+++ b/ja/api/nuxt.md
@@ -0,0 +1,38 @@
+---
+title: "API: Nuxt(options)"
+description: You can use nuxt.js programmatically to use it as a middleware giving you the freedom of creating your own server for rendering your web applications.
+---
+
+# Using Nuxt.js Programmatically
+
+You might want to use your own server with your middleware and your API. That's why you can use Nuxt.js programmatically.
+Nuxt.js is built on the top of ES2015, which makes the code more enjoyable and cleaner to read. It doesn't make use of any transpilers and depends upon Core V8 implemented features. For these reasons, Nuxt.js targets Node.js `4.0` or higher.
+
+You can require Nuxt.js like this:
+```js
+const Nuxt = require('nuxt')
+```
+
+## Nuxt(options)
+
+To see the list of options to give to Nuxt.js, see the configuration section.
+
+```js
+const options = {}
+
+const nuxt = new Nuxt(options)
+nuxt.build()
+.then(() => {
+ // We can use nuxt.render(req, res) or nuxt.renderRoute(route, context)
+})
+```
+
+You can take a look at the [nuxt-express](https://github.com/nuxt/express) and [adonuxt](https://github.com/nuxt/adonuxt) starters to start quickly.
+
+### Debug logs
+
+If you want to display nuxt.js logs, you can add to the top of your file:
+
+```js
+process.env.DEBUG = 'nuxt:*'
+```
diff --git a/ja/api/pages-fetch.md b/ja/api/pages-fetch.md
new file mode 100644
index 000000000..aa8cf8c72
--- /dev/null
+++ b/ja/api/pages-fetch.md
@@ -0,0 +1,49 @@
+---
+title: "API: The fetch Method"
+description: The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+---
+
+# The fetch Method
+
+> The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+
+- **Type:** `Function`
+
+The `fetch` method, *if set*, is called every time before loading the component (**only for pages components**). It can be called from the server-side or before navigating to the corresponding route.
+
+The `fetch` method receives [the context](/api#context) as the first argument, we can use it to fetch some data and fill the store. To make the fetch method asynchronous, **return a Promise**, nuxt.js will wait for the promise to be resolved before rendering the Component.
+
+Example of `pages/index.vue`:
+```html
+
+
Stars: {{ $store.state.stars }}
+
+
+
+```
+
+You can also use async/await to make your code cleaner:
+
+```html
+
+
Stars: {{ $store.state.stars }}
+
+
+
+```
diff --git a/ja/api/pages-head.md b/ja/api/pages-head.md
new file mode 100644
index 000000000..7df5436d6
--- /dev/null
+++ b/ja/api/pages-head.md
@@ -0,0 +1,40 @@
+---
+title: "API: The head Method"
+description: Nuxt.js uses vue-meta to update the `headers` and `html attributes` of your application.
+---
+
+# The head Method
+
+> Nuxt.js uses [vue-meta](https://github.com/declandewet/vue-meta) to update the `headers` and `html attributes` of your application.
+
+- **Type:** `Object` or `Function`
+
+Use the `head` method to set the HTML Head tags for the current page.
+
+Your component data are available with `this` in the `head` method, you can use set custom meta tags with the page data.
+
+```html
+
+
{{ title }}
+
+
+
+```
+
+
To avoid any duplication when used in child component, please give a unique identifier with the `hid` key, please [read more about it](https://github.com/declandewet/vue-meta#lists-of-tags).
diff --git a/ja/api/pages-layout.md b/ja/api/pages-layout.md
new file mode 100644
index 000000000..5d28db248
--- /dev/null
+++ b/ja/api/pages-layout.md
@@ -0,0 +1,24 @@
+---
+title: "API: The layout Property"
+description: Every file (first level) in the layouts directory will create a custom layout accessible with the layout property in the page component.
+---
+
+# The layout Property
+
+> Every file (first level) in the layouts directory will create a custom layout accessible with the layout property in the page component.
+
+- **Type:** `String` (default: `'default'`)
+
+Use the `layout` key in your pages components to define which layout to use:
+
+```js
+export default {
+ layout: 'blog'
+}
+```
+
+In this example, Nuxt.js will include the `layouts/blog.vue` file as a layout for this page component.
+
+Check the [demonstration video](https://www.youtube.com/watch?v=YOKnSTp7d38) to see it in action.
+
+To understand how the layouts work with nuxt.js, take a look at the [layout documentation](/guide/views#layouts).
diff --git a/ja/api/pages-middleware.md b/ja/api/pages-middleware.md
new file mode 100644
index 000000000..45c8155cc
--- /dev/null
+++ b/ja/api/pages-middleware.md
@@ -0,0 +1,38 @@
+---
+title: "API: The middleware Property"
+description: Set the middleware for a specific page of the application.
+---
+
+# The middleware Property
+
+- Type: `String` or `Array`
+ - Items: `String`
+
+Set the middleware for a specific page of the application.
+
+Example:
+
+`pages/secret.vue`
+```html
+
+
Secret page
+
+
+
+```
+
+`middleware/authenticated.js`
+```js
+export default function ({ store, redirect }) {
+ // If the user is not authenticated
+ if (!store.state.authenticated) {
+ return redirect('/login')
+ }
+}
+```
+
+To learn more about the middleware, see the [middleware guide](/guide/routing#middleware).
diff --git a/ja/api/pages-scrolltotop.md b/ja/api/pages-scrolltotop.md
new file mode 100644
index 000000000..b07b319bd
--- /dev/null
+++ b/ja/api/pages-scrolltotop.md
@@ -0,0 +1,26 @@
+---
+title: "API: The scrollToTop Property"
+description: The scrollToTop property lets you tell nuxt.js to scroll to the top before rendering the page.
+---
+
+# The scrollToTop Property
+
+> The scrollToTop property lets you tell nuxt.js to scroll to the top before rendering the page.
+
+- **Type:** `Boolean` (default: `false`)
+
+By default, nuxt.js scroll to the top when you go to another page, but with children routes, nuxt.js keep the scroll position, if you want to tell nuxt.js to scroll to the top when rendering your child route, set `scrollToTop: true`:
+
+```html
+
+
My child component
+
+
+
+```
+
+If you want to overwrite the default scroll behavior of nuxt.js, take a look at the [scrollBehavior option](/api/configuration-router#scrollBehavior).
diff --git a/ja/api/pages-transition.md b/ja/api/pages-transition.md
new file mode 100644
index 000000000..085761cf0
--- /dev/null
+++ b/ja/api/pages-transition.md
@@ -0,0 +1,105 @@
+---
+title: "API: The transition Property"
+description: Nuxt.js uses the transition component to let you create amazing transitions/animations between your pages.
+---
+
+# The transition Property
+
+> Nuxt.js uses the [<transition>](http://vuejs.org/v2/guide/transitions.html#Transitioning-Single-Elements-Components) component to let you create amazing transitions/animations between your pages.
+
+- **Type:** `String` or `Object` or `Function`
+
+To define a custom transition for a specific route, simply add the `transition` key to the page component.
+
+```js
+export default {
+ // Can be a String
+ transition: ''
+ // Or an Object
+ transition: {}
+ // or a Function
+ transition (to, from) {}
+}
+```
+
+## String
+
+If the `transition` key is set as a string, it will be used as the `transition.name`.
+
+```js
+export default {
+ transition: 'test'
+}
+```
+
+Nuxt.js will use these settings to set the component as follows:
+
+```html
+
+```
+
+## Object
+
+If the `transition` key is set as an object:
+
+```js
+export default {
+ transition: {
+ name: 'test',
+ mode: 'out-in'
+ }
+}
+```
+
+Nuxt.js will use these settings to set the component as follows:
+
+```html
+
+```
+
+The following properties that the `transition` object can have:
+
+| key | Type | Default | definition |
+|------|------|---------|-----------|
+| `name` | String | `"page"` | The transition name applied on all the routes transitions. |
+| `mode` | String | `"out-in"` | The transition mode applied on all routes, see [Vue.js documentation](http://vuejs.org/v2/guide/transitions.html#Transition-Modes). |
+| `css` | Boolean | `true` | Whether to apply CSS transition classes. Defaults to true. If set to false, will only trigger JavaScript hooks registered via component events. |
+| `type` | String | `n/a` | Specify the type of transition events to wait for to determine transition end timing. Available values are "transition" and "animation". By default, it will automatically detect the type that has a longer duration. |
+| `enterClass` | String | `n/a` | The starting state of the transition class. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+| `enterToClass` | String | `n/a` | The ending state for the transition. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+| `enterActiveClass` | String | `n/a` | The class applied across the entire transition duration. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+| `leaveClass` | String | `n/a` | The starting state of the transition class. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+| `leaveToClass` | String | `n/a` | The ending state for the transition. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+| `leaveActiveClass` | String | `n/a` | The class applied across the entire transition duration. See [Vue.js documentation](https://vuejs.org/v2/guide/transitions.html#Custom-Transition-Classes) |
+
+
+You can also define methods in the `transition`, these are for the [JavaScript hooks](https://vuejs.org/v2/guide/transitions.html#JavaScript-Hooks):
+
+- beforeEnter(el)
+- enter(el, done)
+- afterEnter(el)
+- enterCancelled(el)
+- beforeLeave(el)
+- leave(el, done)
+- afterLeave(el)
+- leaveCancelled(el)
+
+*Note: it’s also a good idea to explicitly add `css: false` for JavaScript-only transitions so that Vue can skip the CSS detection. This also prevents CSS rules from accidentally interfering with the transition.*
+
+## Function
+
+If the `transition` key is set as a function:
+
+```js
+export default {
+ transition (to, from) {
+ if (!from) return 'slide-left'
+ return +to.query.page < +from.query.page ? 'slide-right' : 'slide-left'
+ }
+}
+```
+
+Transitions applied on navigation:
+- `/` to `/posts` => `slide-left`
+- `/posts` to `/posts?page=3` => `slide-left`
+- `/posts?page=3` to `/posts?page=2` => `slide-right`
diff --git a/ja/api/pages-validate.md b/ja/api/pages-validate.md
new file mode 100644
index 000000000..9ed52230d
--- /dev/null
+++ b/ja/api/pages-validate.md
@@ -0,0 +1,30 @@
+---
+title: "API: The validate Method"
+description: Nuxt.js lets you define a validator method inside your dynamic route component.
+---
+
+# The validate Method
+
+> Nuxt.js lets you define a validator method inside your dynamic route component.
+
+- **Type:** `Function`
+
+```js
+validate({ params, query }) {
+ return true // if the params are valid
+ return false // will stop Nuxt.js to render the route and display the error page
+}
+```
+
+Nuxt.js lets you define a validator method inside your dynamic route component (In this example: `pages/users/_id.vue`).
+
+If the validate method does not return `true`, Nuxt.js will automatically load the 404 error page.
+
+```js
+export default {
+ validate ({ params }) {
+ // Must be a number
+ return /^\d+$/.test(params.id)
+ }
+}
+```
diff --git a/ja/examples/async-data.md b/ja/examples/async-data.md
new file mode 100644
index 000000000..0fa258040
--- /dev/null
+++ b/ja/examples/async-data.md
@@ -0,0 +1,6 @@
+---
+title: Async Data
+description: Async Data example with Nuxt.js
+github: async-data
+documentation: /guide/async-data
+---
diff --git a/ja/examples/auth-routes.md b/ja/examples/auth-routes.md
new file mode 100644
index 000000000..033b605ed
--- /dev/null
+++ b/ja/examples/auth-routes.md
@@ -0,0 +1,210 @@
+---
+title: Auth Routes
+description: Authenticated routes example with Nuxt.js
+github: auth-routes
+livedemo: https://nuxt-auth-routes.gomix.me
+liveedit: https://gomix.com/#!/project/nuxt-auth-routes
+---
+
+# Documentation
+
+> Nuxt.js can be used to create authenticated routes easily.
+
+## Using Express and Sessions
+
+To add the sessions feature in our application, we will use `express` and `express-session`, for this, we need to use Nuxt.js programmatically.
+
+First, we install the dependencies:
+```bash
+yarn add express express-session body-parser whatwg-fetch
+```
+
+*We will talk about `whatwg-fetch` later.*
+
+Then we create our `server.js`:
+```js
+const Nuxt = require('nuxt')
+const bodyParser = require('body-parser')
+const session = require('express-session')
+const app = require('express')()
+
+// Body parser, to access req.body
+app.use(bodyParser.json())
+
+// Sessions to create req.session
+app.use(session({
+ secret: 'super-secret-key',
+ resave: false,
+ saveUninitialized: false,
+ cookie: { maxAge: 60000 }
+}))
+
+// POST /api/login to log in the user and add him to the req.session.authUser
+app.post('/api/login', function (req, res) {
+ if (req.body.username === 'demo' && req.body.password === 'demo') {
+ req.session.authUser = { username: 'demo' }
+ return res.json({ username: 'demo' })
+ }
+ res.status(401).json({ error: 'Bad credentials' })
+})
+
+// POST /api/logout to log out the user and remove it from the req.session
+app.post('/api/logout', function (req, res) {
+ delete req.session.authUser
+ res.json({ ok: true })
+})
+
+// We instantiate Nuxt.js with the options
+const isProd = process.env.NODE_ENV === 'production'
+const nuxt = new Nuxt({ dev: !isProd })
+// No build in production
+const promise = (isProd ? Promise.resolve() : nuxt.build())
+promise.then(() => {
+ app.use(nuxt.render)
+ app.listen(3000)
+ console.log('Server is listening on http://localhost:3000')
+})
+.catch((error) => {
+ console.error(error)
+ process.exit(1)
+})
+```
+
+And we update our `package.json` scripts:
+```json
+// ...
+"scripts": {
+ "dev": "node server.js",
+ "build": "nuxt build",
+ "start": "NODE_ENV=production node server.js"
+}
+// ...
+```
+
+## Using the store
+
+We need a global state to let our application know if the user is connected **across the pages**.
+
+To let Nuxt.js use Vuex, we create a `store/index.js` file:
+
+```js
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+// Polyfill for window.fetch()
+require('whatwg-fetch')
+
+const store = new Vuex.Store({
+
+ state: {
+ authUser: null
+ },
+
+ mutations: {
+ SET_USER: function (state, user) {
+ state.authUser = user
+ }
+ },
+
+ actions: {
+ // ...
+ }
+
+})
+
+export default store
+```
+
+1. We import `Vue` and `Vuex` (included in Nuxt.js) and we tell Vue to use Vuex to let us use `$store` in our components
+2. We `require('whatwg-fetch')` to polyfill the `fetch()` method across all browsers (see [fetch repo](https://github.com/github/fetch))
+3. We create our `SET_USER` mutation which will set the `state.authUser` to the conntected user
+4. We export our store instance to Nuxt.js can inject it to our main application
+
+### nuxtServerInit() action
+
+Nuxt.js will call a specific action called `nuxtServerInit` with the context in argument, so when the app will be loaded, the store will be already filled with some data we can get from the server.
+
+In our `store/index.js`, we can add the `nuxtServerInit` action:
+```js
+nuxtServerInit ({ commit }, { req }) {
+ if (req.session && req.session.authUser) {
+ commit('SET_USER', req.session.authUser)
+ }
+}
+```
+
+### login() action
+
+We add a `login` action which will be called from our pages component to log in the user:
+```js
+login ({ commit }, { username, password }) {
+ return fetch('/api/login', {
+ // Send the client cookies to the server
+ credentials: 'same-origin',
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ username,
+ password
+ })
+ })
+ .then((res) => {
+ if (res.status === 401) {
+ throw new Error('Bad credentials')
+ } else {
+ return res.json()
+ }
+ })
+ .then((authUser) => {
+ commit('SET_USER', authUser)
+ })
+}
+```
+
+### logout() method
+
+```js
+logout ({ commit }) {
+ return fetch('/api/logout', {
+ // Send the client cookies to the server
+ credentials: 'same-origin',
+ method: 'POST'
+ })
+ .then(() => {
+ commit('SET_USER', null)
+ })
+}
+```
+
+## Pages components
+
+Then we can use `$store.state.authUser` in our pages components to check if the user is connected in our application or not.
+
+### Redirect user if not connected
+
+Let's add a `/secret` route where only the connected user can see its content:
+```html
+
+
+
Super secret page
+ Back to the home page
+
+
+
+
+```
+
+We can see in the `fetch` method that we call `redirect('/')` when our user is not connected.
diff --git a/ja/examples/cached-components.md b/ja/examples/cached-components.md
new file mode 100644
index 000000000..1f95cb110
--- /dev/null
+++ b/ja/examples/cached-components.md
@@ -0,0 +1,6 @@
+---
+title: Cached Components
+description: Cached Components example with Nuxt.js
+github: cached-components
+documentation: /api/configuration-cache
+---
\ No newline at end of file
diff --git a/ja/examples/custom-loading.md b/ja/examples/custom-loading.md
new file mode 100644
index 000000000..d2715818b
--- /dev/null
+++ b/ja/examples/custom-loading.md
@@ -0,0 +1,7 @@
+---
+title: Custom Loading Component
+description: Custom Loading Component example with Nuxt.js
+github: custom-loading
+livedemo: https://custom-loading.nuxtjs.org
+documentation: /api/configuration-loading
+---
diff --git a/ja/examples/custom-routes.md b/ja/examples/custom-routes.md
new file mode 100644
index 000000000..a9887d9d1
--- /dev/null
+++ b/ja/examples/custom-routes.md
@@ -0,0 +1,7 @@
+---
+title: Custom Routes
+description: Custom Routes example with Nuxt.js
+github: custom-routes
+livedemo: https://custom-routes.nuxtjs.org
+documentation: /guide/routing#dynamic-routes
+---
diff --git a/ja/examples/global-css.md b/ja/examples/global-css.md
new file mode 100644
index 000000000..ecf624f44
--- /dev/null
+++ b/ja/examples/global-css.md
@@ -0,0 +1,7 @@
+---
+title: Global CSS
+description: Global CSS example with Nuxt.js
+github: global-css
+livedemo: https://global-css.nuxtjs.org
+documentation: /api/configuration-css
+---
diff --git a/ja/examples/hello-world.md b/ja/examples/hello-world.md
new file mode 100644
index 000000000..472023d18
--- /dev/null
+++ b/ja/examples/hello-world.md
@@ -0,0 +1,9 @@
+---
+title: Hello World
+description: Hello World example with Nuxt.js
+github: hello-world
+youtube: https://www.youtube.com/embed/kmf-p-pTi40
+livedemo: https://hello-world.nuxtjs.org
+liveedit: https://gomix.com/#!/project/nuxt-hello-world
+documentation: /guide/installation#starting-from-scratch
+---
diff --git a/ja/examples/i18n.md b/ja/examples/i18n.md
new file mode 100644
index 000000000..ab3b9c629
--- /dev/null
+++ b/ja/examples/i18n.md
@@ -0,0 +1,7 @@
+---
+title: Internationalization (i18n)
+description: Internationalization (i18n) example with Nuxt.js
+github: i18n
+livedemo: https://i18n.nuxtjs.org
+documentation: /guide/routing#middleware
+---
diff --git a/ja/examples/layouts.md b/ja/examples/layouts.md
new file mode 100644
index 000000000..c5960c826
--- /dev/null
+++ b/ja/examples/layouts.md
@@ -0,0 +1,8 @@
+---
+title: Layouts
+description: Layouts example with Nuxt.js
+github: custom-layouts
+livedemo: https://nuxt-custom-layouts.gomix.me/
+liveedit: https://gomix.com/#!/project/nuxt-custom-layouts
+documentation: /guide/views#layouts
+---
diff --git a/ja/examples/menu.json b/ja/examples/menu.json
new file mode 100644
index 000000000..45980e702
--- /dev/null
+++ b/ja/examples/menu.json
@@ -0,0 +1,33 @@
+[
+ {
+ "title": "Essentials",
+ "links": [
+ { "name": "Hello world", "to": "" },
+ { "name": "SEO HTML Head", "to": "/seo-html-head" }
+ ]
+ },
+ {
+ "title": "Customization",
+ "links": [
+ { "name": "Cached Components", "to": "/cached-components" },
+ { "name": "Custom Loading", "to": "/custom-loading" },
+ { "name": "Custom Routes", "to": "/custom-routes" },
+ { "name": "Global CSS", "to": "/global-css" },
+ { "name": "Layouts", "to": "/layouts" },
+ { "name": "Middleware", "to": "/middleware" },
+ { "name": "Nested Routes", "to": "/nested-routes" },
+ { "name": "Plugins", "to": "/plugins" },
+ { "name": "Routes transitions", "to": "/routes-transitions" }
+ ]
+ },
+ {
+ "title": "Advanced",
+ "links": [
+ { "name": "Async Data", "to": "/async-data" },
+ { "name": "Auth Routes", "to": "/auth-routes" },
+ { "name": "Vuex Store", "to": "/vuex-store" },
+ { "name": "i18n", "to": "/i18n" },
+ { "name": "Testing", "to": "/testing" }
+ ]
+ }
+]
diff --git a/ja/examples/middleware.md b/ja/examples/middleware.md
new file mode 100644
index 000000000..afd8a1552
--- /dev/null
+++ b/ja/examples/middleware.md
@@ -0,0 +1,7 @@
+---
+title: Middleware
+description: Middleware example with Nuxt.js
+github: middleware
+livedemo: https://middleware.nuxtjs.org
+documentation: /guide/routing#middleware
+---
diff --git a/ja/examples/nested-routes.md b/ja/examples/nested-routes.md
new file mode 100644
index 000000000..471fd28cc
--- /dev/null
+++ b/ja/examples/nested-routes.md
@@ -0,0 +1,7 @@
+---
+title: Nested Routes
+description: Nested Routes example with Nuxt.js
+github: nested-routes
+livedemo: https://nested-routes.nuxtjs.org
+documentation: /guide/routing#nested-routes
+---
diff --git a/ja/examples/plugins.md b/ja/examples/plugins.md
new file mode 100644
index 000000000..d33ed90a5
--- /dev/null
+++ b/ja/examples/plugins.md
@@ -0,0 +1,7 @@
+---
+title: Plugins
+description: Using external modules and plugins with nuxt.js
+github: plugins-vendor
+livedemo: https://plugins-vendor.nuxtjs.org
+documentation: /guide/plugins
+---
diff --git a/ja/examples/routes-transitions.md b/ja/examples/routes-transitions.md
new file mode 100644
index 000000000..913888b35
--- /dev/null
+++ b/ja/examples/routes-transitions.md
@@ -0,0 +1,8 @@
+---
+title: Routes transitions
+description: Routes transitions example with Nuxt.js
+github: routes-transitions
+youtube: https://www.youtube.com/embed/RIXOzJWFfc8
+livedemo: https://routes-transitions.nuxtjs.org
+documentation: /guide/routing#transitions
+---
diff --git a/ja/examples/seo-html-head.md b/ja/examples/seo-html-head.md
new file mode 100644
index 000000000..02525b10b
--- /dev/null
+++ b/ja/examples/seo-html-head.md
@@ -0,0 +1,7 @@
+---
+title: SEO HTML Head
+description: SEO HTML Head example with Nuxt.js
+github: head-elements
+livedemo: https://head-elements.nuxtjs.org
+documentation: /guide/views#html-head
+---
diff --git a/ja/examples/testing.md b/ja/examples/testing.md
new file mode 100644
index 000000000..1221672b4
--- /dev/null
+++ b/ja/examples/testing.md
@@ -0,0 +1,6 @@
+---
+title: Testing
+description: Testing example with Nuxt.js
+github: with-ava
+documentation: /guide/development-tools#end-to-end-testing
+---
diff --git a/ja/examples/vuex-store.md b/ja/examples/vuex-store.md
new file mode 100644
index 000000000..e4ff096c1
--- /dev/null
+++ b/ja/examples/vuex-store.md
@@ -0,0 +1,7 @@
+---
+title: Vuex Store
+description: Vuex Store example with Nuxt.js
+github: vuex-store
+livedemo: https://vuex-store.nuxtjs.org
+documentation: /guide/vuex-store
+---
diff --git a/ja/faq/async-data-components.md b/ja/faq/async-data-components.md
new file mode 100644
index 000000000..b96e4e2f2
--- /dev/null
+++ b/ja/faq/async-data-components.md
@@ -0,0 +1,14 @@
+---
+title: Async data in components
+description: Async data in components?
+---
+
+# Async data in components?
+
+It is not possible because it's not linked to a route, Nuxt.js surcharges the component data() associated to a route to allow async data.
+
+For sub components, there are 2 ways of achieving it:
+1. Making the API call in the mounted() hook and setting the data afterwards, downside: no server rendering
+2. Making the API call in the data() of the page component and giving the data as a prop to the subComponent: server rendering OK. But the data() of the page might be less readable because it's loading the async data of the sub components
+
+It all depends if you want the sub components to be server-rendered or not.
diff --git a/ja/faq/css-flash.md b/ja/faq/css-flash.md
new file mode 100644
index 000000000..41a5ed34e
--- /dev/null
+++ b/ja/faq/css-flash.md
@@ -0,0 +1,12 @@
+---
+title: CSS Flash
+description: Why a CSS Flash appears with Nuxt.js?
+---
+
+# Why a CSS Flash appears?
+
+
+
+This is because the CSS is in the JavaScript build in **development mode** to allow hot-reloading via Webpack.
+
+Don't worry in production mode, the CSS is separated and put in the header so this "flash" does not appear anymore.
diff --git a/ja/faq/duplicated-meta-tags.md b/ja/faq/duplicated-meta-tags.md
new file mode 100644
index 000000000..235a51f11
--- /dev/null
+++ b/ja/faq/duplicated-meta-tags.md
@@ -0,0 +1,42 @@
+---
+title: Duplicated Meta tags
+description: Duplicated Meta tags with Nuxt.js?
+---
+
+# Duplicated Meta tags?
+
+This is a "feature" of [vue-meta](https://github.com/declandewet/vue-meta), please take a look at the [documentation of head elements](https://nuxtjs.org/guide/html-head#defaults-meta).
+
+> To avoid any duplication when used in child component, please give a unique identifier with the hid key, please [read more](https://github.com/declandewet/vue-meta#lists-of-tags) about it.
+
+For the meta description, you need to add the unique identifier `hid` so vue-meta will know that it has to overwrite the default tag.
+
+Your `nuxt.config.js`:
+```js
+...head: {
+ title: 'starter',
+ meta: [
+ { charset: 'utf-8' },
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
+ { name: 'keywords', content: 'keyword 1, keyword 2'},
+ { hid: 'description', name: 'description', content: 'This is the generic description.'}
+ ],
+ },
+...
+```
+
+An then in your individual page:
+```js
+export default {
+ head () {
+ return {
+ title: `Page 1 (${this.name}-side)`,
+ meta: [
+ { hid: 'description', name: 'description', content: "Page 1 description" }
+ ],
+ }
+ }
+}
+```
+
+To learn how to use the `head` property in your pages, please see the [HTML head documentation](/guide/views/#html-head).
diff --git a/ja/faq/extend-webpack.md b/ja/faq/extend-webpack.md
new file mode 100644
index 000000000..c2500ad25
--- /dev/null
+++ b/ja/faq/extend-webpack.md
@@ -0,0 +1,18 @@
+---
+title: Extend Webpack
+description: How to extend webpack config?
+---
+
+# How to extend webpack config?
+
+You can extend the webpack configuration via the `extend` option in your `nuxt.config.js`:
+
+```js
+module.exports = {
+ build: {
+ extend (config, { isDev, isClient }) {
+ // ...
+ }
+ }
+}
+```
diff --git a/ja/faq/external-resources.md b/ja/faq/external-resources.md
new file mode 100644
index 000000000..a12f2a51e
--- /dev/null
+++ b/ja/faq/external-resources.md
@@ -0,0 +1,46 @@
+---
+title: External resources
+description: How to use external resources with Nuxt.js?
+---
+
+# How to use external resources?
+
+## Global Settings
+
+Include your resources in the `nuxt.config.js` file:
+
+```js
+module.exports = {
+ head: {
+ script: [
+ { src: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js' }
+ ],
+ link: [
+ { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' }
+ ]
+ }
+}
+```
+
+## Local Settings
+
+Include your resources in your .vue file inside the pages directory:
+
+```html
+
+
About page with jQuery and Roboto font
+
+
+
+```
diff --git a/ja/faq/github-pages.md b/ja/faq/github-pages.md
new file mode 100644
index 000000000..205dabb37
--- /dev/null
+++ b/ja/faq/github-pages.md
@@ -0,0 +1,44 @@
+---
+title: Github Pages Deployment
+description: How to deploy Nuxt.js on Github Pages?
+---
+
+# How to deploy on Github Pages?
+
+Nuxt.js gives you the possibility to host your web application on any static hosting like [Github Pages](https://pages.github.com/) for example.
+
+To deploy on Github Pages, you need to generate your static web application:
+
+```bash
+npm run generate
+```
+
+It will create a `dist` folder with everything inside ready to be deployed on Github Pages hosting.
+Branch `gh-pages` for project repository OR branch `master` for user or organization site
+
+## Command line deployment
+
+You can also use [push-dir package](https://github.com/L33T-KR3W/push-dir):
+
+First install it via npm:
+```bash
+npm install push-dir --save-dev
+```
+
+Add a `deploy` command to your package.json with the branch as `gh-pages` for project repository OR `master` for user or organization site.
+
+```js
+"scripts": {
+ "dev": "nuxt",
+ "build": "nuxt build",
+ "start": "nuxt start",
+ "generate": "nuxt generate",
+ "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup"
+},
+```
+
+Then generate and deploy your static application:
+```bash
+npm run generate
+npm run deploy
+```
diff --git a/ja/faq/google-analytics.md b/ja/faq/google-analytics.md
new file mode 100644
index 000000000..6d094dbf3
--- /dev/null
+++ b/ja/faq/google-analytics.md
@@ -0,0 +1,60 @@
+---
+title: Google Analytics Integration
+description: How to use Google Analytics?
+---
+
+## How to use Google Analytics?
+
+To use [Google Analytics](https://analytics.google.com/analytics/web/) with your nuxt.js application, we recommend to create a file `plugins/ga.js`:
+
+```js
+/*
+** Only run on client-side and only in production mode
+*/
+if (process.BROWSER_BUILD && process.env.NODE_ENV === 'production') {
+ /*
+ ** Include Google Analytics Script
+ */
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ /*
+ ** Set the current page
+ */
+ ga('create', 'UA-XXXXXXXX-X', 'auto')
+ ga('send', 'pageview')
+ /*
+ ** When the app is mounted
+ */
+ window.onNuxtReady((app) => {
+ /*
+ ** Every time the route changes
+ */
+ app.$nuxt.$on('routeChanged', (to, from) => {
+ /*
+ ** We tell Google Analytic to add a page view
+ */
+ ga('set', 'page', to.fullPath)
+ ga('send', 'pageview')
+ })
+ })
+}
+```
+
+> Replace `UA-XXXXXXXX-X` by your Google Analytics tracking ID.
+
+Then, we tell nuxt.js to import it in our main application:
+
+`nuxt.config.js`
+```js
+module.exports = {
+ plugins: [
+ '~plugins/ga.js'
+ ]
+}
+```
+
+Voilà, Google Analytics is integrated into your nuxt.js application and will track every page view!
+
+
INFO: you can use this method for any other tracking service.
diff --git a/ja/faq/heroku-deployment.md b/ja/faq/heroku-deployment.md
new file mode 100644
index 000000000..d077f027f
--- /dev/null
+++ b/ja/faq/heroku-deployment.md
@@ -0,0 +1,40 @@
+---
+title: Heroku Deployment
+description: How to deploy Nuxt.js on Heroku?
+---
+
+# How to deploy on Heroku?
+
+We recommend you to read the [Heroku documentation for node.js](https://devcenter.heroku.com/articles/nodejs-support).
+
+First, we need to tell Heroku to install the `devDependencies` of the project (to be able to launch `npm run build`):
+```bash
+heroku config:set NPM_CONFIG_PRODUCTION=false
+```
+
+Also, we want our application to listen on the port `0.0.0.0` and run in production mode:
+```bash
+heroku config:set HOST=0.0.0.0
+heroku config:set NODE_ENV=production
+```
+
+You should see this in your Heroku dashboard (Settings section):
+
+
+
+Then, we tell Heroku to launch `npm run build` via the `heroku-postbuild` script in our `package.json`:
+```js
+"scripts": {
+ "dev": "nuxt",
+ "build": "nuxt build",
+ "start": "nuxt start",
+ "heroku-postbuild": "npm run build"
+}
+```
+
+Finally, we can push the app on Heroku with:
+```bash
+git push heroku master
+```
+
+Voilà! Your nuxt.js application is now hosted on Heroku!
diff --git a/ja/faq/host-port.md b/ja/faq/host-port.md
new file mode 100644
index 000000000..5c97c492f
--- /dev/null
+++ b/ja/faq/host-port.md
@@ -0,0 +1,26 @@
+---
+title: HOST and PORT
+description: How to edit HOST and PORT with Nuxt.js?
+---
+
+# How to edit HOST and PORT?
+
+You can configure the PORT with 2 different ways:
+- Via a env variables
+```js
+"scripts": {
+ "dev": "HOST=0.0.0.0 PORT=3333 nuxt"
+}
+```
+- Via a nuxt config in the `package.json`:
+```js
+"config": {
+ "nuxt": {
+ "host": "0.0.0.0",
+ "port": "3333"
+ }
+},
+"scripts": {
+ "dev": "nuxt"
+}
+```
diff --git a/ja/faq/jsx.md b/ja/faq/jsx.md
new file mode 100644
index 000000000..9fb99a155
--- /dev/null
+++ b/ja/faq/jsx.md
@@ -0,0 +1,43 @@
+---
+title: JSX
+description: How to use JSX with Nuxt.js?
+---
+
+# How to use JSX?
+
+If you want to use JSX in your components, first, you need to install the Babel plugins for JSX:
+
+```bash
+npm install --save-dev babel-plugin-syntax-jsx babel-plugin-transform-vue-jsx babel-helper-vue-jsx-merge-props
+```
+
+Then, in your `nuxt.config.js`, tell nuxt.js to use the [transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx) plugin:
+
+```js
+module.exports = {
+ build: {
+ babel: {
+ plugins: ['transform-vue-jsx']
+ }
+ }
+}
+```
+
+To learn more about the babel option, take a look at the [build config documentation](/api/configuration-build).
+
+You can now use JSX in your `render` method of your components:
+
+```html
+
+```
+
+You can learn more how to use it in the [JSX section](https://vuejs.org/v2/guide/render-function.html#JSX) of the Vue.js documentation.
diff --git a/ja/faq/menu.json b/ja/faq/menu.json
new file mode 100644
index 000000000..ba43e2a84
--- /dev/null
+++ b/ja/faq/menu.json
@@ -0,0 +1,33 @@
+[
+ {
+ "title": "Configuration",
+ "links": [
+ { "name": "How to use external resources?", "to": "" },
+ { "name": "How to use pre-processors?", "to": "/pre-processors" },
+ { "name": "How to use JSX?", "to": "/jsx" },
+ { "name": "How to add postcss plugins?", "to": "/postcss-plugins" },
+ { "name": "How to extend webpack config?", "to": "/extend-webpack" },
+ { "name": "How to add webpack plugins?", "to": "/webpack-plugins" },
+ { "name": "How to edit HOST and PORT?", "to": "/host-port" },
+ { "name": "How to use Google Analytics?", "to": "/google-analytics" }
+ ]
+ },
+ {
+ "title": "Development",
+ "links": [
+ { "name": "Window/Document undefined?", "to": "/window-document-undefined" },
+ { "name": "Why a CSS Flash appears?", "to": "/css-flash" },
+ { "name": "Async data in components?", "to": "/async-data-components" },
+ { "name": "Duplicated Meta Tags?", "to": "/duplicated-meta-tags" }
+ ]
+ },
+ {
+ "title": "Deployment",
+ "links": [
+ { "name": "How to deploy on Heroku?", "to": "/heroku-deployment" },
+ { "name": "How to deploy with Now.sh?", "to": "/now-deployment" },
+ { "name": "How to deploy with Surge.sh?", "to": "/surge-deployment" },
+ { "name": "How to deploy on Github?", "to": "/github-pages" }
+ ]
+ }
+]
diff --git a/ja/faq/now-deployment.md b/ja/faq/now-deployment.md
new file mode 100644
index 000000000..e796d437d
--- /dev/null
+++ b/ja/faq/now-deployment.md
@@ -0,0 +1,25 @@
+---
+title: Now Deployment
+description: How to deploy Nuxt.js with Now.sh?
+---
+
+# How to deploy with Now.sh?
+
+To deploy with [now.sh](https://zeit.co/now) a `package.json` like follows is recommended:
+```json
+{
+ "name": "my-app",
+ "dependencies": {
+ "nuxt": "latest"
+ },
+ "scripts": {
+ "dev": "nuxt",
+ "build": "nuxt build",
+ "start": "nuxt start"
+ }
+}
+```
+
+Then run `now` and enjoy!
+
+Note: we recommend putting `.nuxt` in `.npmignore` or `.gitignore`.
diff --git a/ja/faq/postcss-plugins.md b/ja/faq/postcss-plugins.md
new file mode 100644
index 000000000..3f83d2476
--- /dev/null
+++ b/ja/faq/postcss-plugins.md
@@ -0,0 +1,20 @@
+---
+title: Postcss plugins
+description: How to add postcss plugins?
+---
+
+# How to add postcss plugins?
+
+In your `nuxt.config.js` file:
+
+```js
+module.exports = {
+ build: {
+ postcss: [
+ require('postcss-nested')(),
+ require('postcss-responsive-type')(),
+ require('postcss-hexrgba')(),
+ ]
+ }
+}
+```
diff --git a/ja/faq/pre-processors.md b/ja/faq/pre-processors.md
new file mode 100644
index 000000000..235ad9ce3
--- /dev/null
+++ b/ja/faq/pre-processors.md
@@ -0,0 +1,31 @@
+---
+title: Pre-processors
+description: How to use pre-processors with Nuxt.js?
+---
+
+# How to use pre-processors?
+
+Thanks to [vue-loader](http://vue-loader.vuejs.org/en/configurations/pre-processors.html), you can use any kind of pre-processors for your ``, `
+
+
+```
+
+To be able to use these pre-processors, we need to install their webpack loaders:
+```bash
+npm install --save-dev pug@2.0.0-beta6 pug-loader coffee-script coffee-loader node-sass sass-loader
+```
diff --git a/ja/faq/surge-deployment.md b/ja/faq/surge-deployment.md
new file mode 100644
index 000000000..7af82dec5
--- /dev/null
+++ b/ja/faq/surge-deployment.md
@@ -0,0 +1,33 @@
+---
+title: Surge Deployment
+description: How to deploy Nuxt.js with Surge.sh?
+---
+
+# How to deploy with Surge.sh?
+
+Nuxt.js gives you the possibility to host your web application on any static hosting like [surge.sh](https://surge.sh/) for example.
+
+To deploy on surge.sh, first install it on your computer:
+```bash
+npm install -g surge
+```
+
+Then, we tell nuxt.js to generate our web application:
+
+```bash
+npm run generate
+```
+
+It will create a `dist` folder with everything inside ready to be deployed on a static hosting.
+
+We can then deploy it to surge.sh:
+
+```bash
+surge dist/
+```
+
+Done :)
+
+If you have a project with [dynamic routes](/guide/routing#dynamic-routes), take a look at the [generate configuration](/api/configuration-generate) to tell nuxt.js how to generate these dynamic routes.
+
+
When generating your web application with `nuxt generate`, [the context](/api) given to [data()](/guide/async-data#the-data-method) and [fetch()](/guide/vuex-store#the-fetch-method) will not have `req` and `res`.
diff --git a/ja/faq/webpack-plugins.md b/ja/faq/webpack-plugins.md
new file mode 100644
index 000000000..0c874b844
--- /dev/null
+++ b/ja/faq/webpack-plugins.md
@@ -0,0 +1,24 @@
+---
+title: Webpack plugins
+description: How to add webpack plugins?
+---
+
+# How to add webpack plugins?
+
+In your `nuxt.config.js` file:
+
+```js
+const webpack = require('webpack')
+
+module.exports = {
+ build: {
+ plugins: [
+ new webpack.ProvidePlugin({
+ '$': 'jquery',
+ '_': 'lodash'
+ // ...etc.
+ })
+ ]
+ }
+}
+```
diff --git a/ja/faq/window-document-undefined.md b/ja/faq/window-document-undefined.md
new file mode 100644
index 000000000..3a405280c
--- /dev/null
+++ b/ja/faq/window-document-undefined.md
@@ -0,0 +1,23 @@
+---
+title: Window or Document undefined
+description: Window or Document undefined with Nuxt.js?
+---
+
+# Window or Document undefined?
+
+This is due to the server-side rendering.
+If you need to specify that you want to import a resource only on the client-side, you need to use the `process.BROWSER_BUILD` variable.
+
+For example, in your .vue file:
+```js
+if (process.BROWSER_BUILD) {
+ require('external_library')
+}
+```
+
+Don't forget to add your library in the [vendor bundle](/api/configuration-build#build-vendor) in your `nuxt.config.js`:
+```js
+ build: {
+ vendor: ['external_library']
+ }
+```
diff --git a/ja/guide/assets.md b/ja/guide/assets.md
new file mode 100644
index 000000000..7b6faba44
--- /dev/null
+++ b/ja/guide/assets.md
@@ -0,0 +1,98 @@
+---
+title: Assets
+description: Nuxt uses vue-loader, file-loader and url-loader for Webpack by default for strong assets serving, but you can also use Static directory for static assets.
+---
+
+> Nuxt uses vue-loader, file-loader and url-loader for Webpack by default for strong assets serving, but you can also use Static directory for static assets.
+
+## Webpacked
+
+By default, [vue-loader](http://vue-loader.vuejs.org/en/) automatically processes your style and template files with `css-loader` and the Vue template compiler. In this compilation process, all asset URLs such as ``, `background: url(...)` and CSS `@import` are resolved as module dependencies.
+
+For example, we have this file tree:
+
+```bash
+-| assets/
+----| image.png
+-| pages/
+----| index.vue
+```
+
+In my CSS, if I use `url('~assets/image.png')`, it will be translated into `require('~assets/image.png')`.
+
+Or if in my `pages/index.vue`, I use:
+```html
+
+
+
+```
+
+It will be compiled into:
+
+```js
+createElement('img', { attrs: { src: require('~assets/image.png') }})
+```
+
+Because `.png` is not a JavaScript file, nuxt.js configures Webpack to use [file-loader](https://github.com/webpack/file-loader) and [url-loader](https://github.com/webpack/url-loader) to handle them for you.
+
+The benefits of them are:
+- `file-loader` lets you designate where to copy and place the asset file, and how to name it using version hashes for better caching.
+- `url-loader` allows you to conditionally inline a file as base-64 data URL if they are smaller than a given threshold. This can reduce a number of HTTP requests for trivial files. If the file is larger than the threshold, it automatically falls back to `file-loader`.
+
+Actually, Nuxt.js default loaders configuration is:
+
+```js
+[
+ {
+ test: /\.(png|jpe?g|gif|svg)$/,
+ loader: 'url-loader',
+ query: {
+ limit: 1000, // 1KO
+ name: 'img/[name].[hash:7].[ext]'
+ }
+ },
+ {
+ test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+ loader: 'url-loader',
+ query: {
+ limit: 1000, // 1 KO
+ name: 'fonts/[name].[hash:7].[ext]'
+ }
+ }
+]
+```
+
+Which means that every file below 1 KO will be inlined as base-64 data URL. Otherwise, the image/font will be copied in its corresponding folder (under the `.nuxt` directory) with a name containing a version hashes for better caching.
+
+When launching our application with `nuxt`, our template in `pages/index.vue`:
+
+```html
+
+
+
+```
+
+Will be generated into:
+```html
+
+```
+
+If you want to update these loaders or disable them, please take a look at the [loaders configuration](/api/configuration-build#loaders).
+
+## Static
+
+If you don't want to use Webpacked Assets from the `assets` directory, you can create and use the `static` directory in your project root directory.
+
+These files will be automatically serve by Nuxt and accessible in your project root URL.
+
+This option is helpful for files like `robots.txt` or `sitemap.xml`.
+
+From your code you can then reference those files with `/` URLs:
+
+```html
+
+
+
+
+
+```
diff --git a/ja/guide/async-data.md b/ja/guide/async-data.md
new file mode 100644
index 000000000..de3f3fb2e
--- /dev/null
+++ b/ja/guide/async-data.md
@@ -0,0 +1,114 @@
+---
+title: Async Data
+description: Nuxt.js supercharges the data method from vue.js to let you handle async operation before setting the component data.
+---
+
+> Nuxt.js *supercharges* the `data` method from vue.js to let you handle async operation before setting the component data.
+
+## The data Method
+
+`data` is called every time before loading the component (**only for pages components**). It can be called from the server-side or before navigating to the corresponding route. This method receives [the context](/api#context) as the first argument, you can use it to fetch some data and return the component data.
+
+
You do **NOT** have access of the component instance trough `this` inside `data` because it is called **before initiating** the component.
+
+To make the data method asynchronous, nuxt.js offers you different ways, choose the one you're the most familiar with:
+
+1. returning a `Promise`, nuxt.js will wait for the promise to be resolved before rendering the component.
+2. Using the [async/await proposal](https://github.com/lukehoban/ecmascript-asyncawait) ([learn more about it](https://zeit.co/blog/async-and-await))
+3. Define a callback as second argument. It has to be called like this: `callback(err, data)`
+
+### Returning a Promise
+```js
+export default {
+ data ({ params }) {
+ return axios.get(`https://my-api/posts/${params.id}`)
+ .then((res) => {
+ return { title: res.data.title }
+ })
+ }
+}
+```
+
+### Using async/await
+```js
+export default {
+ async data ({ params }) {
+ let { data } = await axios.get(`https://my-api/posts/${params.id}`)
+ return { title: data.title }
+ }
+}
+```
+
+### Using a callback
+```js
+export default {
+ data ({ params }, callback) {
+ axios.get(`https://my-api/posts/${params.id}`)
+ .then((res) => {
+ callback(null, { title: res.data.title })
+ })
+ }
+}
+```
+
+### Returning an Object
+
+If you don't need to do any asynchronous call, you can simply return an object:
+
+```js
+export default {
+ data (context) {
+ return { foo: 'bar' }
+ }
+}
+```
+
+### Displaying the data
+
+When the data method set, you can display the data inside your template like you used to do:
+
+```html
+
+
{{ title }}
+
+```
+
+## The Context
+
+To see the list of available keys in `context`, take a look at the [API Pages data](/api).
+
+## Handling Errors
+
+Nuxt.js add the `error(params)` method in the `context`, you can call it to display the error page. `params.statusCode` will be also used to render the proper status code form the server-side.
+
+Example with a `Promise`:
+```js
+export default {
+ data ({ params, error }) {
+ return axios.get(`https://my-api/posts/${params.id}`)
+ .then((res) => {
+ return { title: res.data.title }
+ })
+ .catch((e) => {
+ error({ statusCode: 404, message: 'Post not found' })
+ })
+ }
+}
+```
+
+If you're using the `callback` argument, you can call it directly with the error, nuxt.js will call the `error` method for you:
+```js
+export default {
+ data ({ params }, callback) {
+ axios.get(`https://my-api/posts/${params.id}`)
+ .then((res) => {
+ callback(null, { title: res.data.title })
+ })
+ .catch((e) => {
+ callback({ statusCode: 404, message: 'Post not found' })
+ })
+ }
+}
+```
+
+To customize the error page, take a look at the [VIEWS layouts section](/guide/views#layouts).
diff --git a/ja/guide/commands.md b/ja/guide/commands.md
new file mode 100644
index 000000000..aab7fce28
--- /dev/null
+++ b/ja/guide/commands.md
@@ -0,0 +1,84 @@
+---
+title: Commands
+description: Nuxt.js comes with a set of useful commands, both for development and production purpose.
+---
+
+> Nuxt.js comes with a set of useful commands, both for development and production purpose.
+
+## List of Commands
+
+| Command | Description |
+|---------|-------------|
+| nuxt | Launch a development server on [localhost:3000](http://localhost:3000) with hot-reloading. |
+| nuxt build | Build your application with webpack and minify the JS & CSS (for production). |
+| nuxt start | Start the server in production mode (After running `nuxt build`). |
+| nuxt generate | Build the application and generate every route as a HTML file (used for static hosting). |
+
+You should put these commands in the `package.json`:
+
+```json
+"scripts": {
+ "dev": "nuxt",
+ "build": "nuxt build",
+ "start": "nuxt start",
+ "generate": "nuxt generate"
+}
+```
+
+Then, you can launch your commands via `npm run ` (example: `npm run dev`).
+
+## Development Environment
+
+To launch Nuxt in development mode with the hot reloading:
+
+```bash
+nuxt
+// OR
+npm run dev
+```
+
+## Production Deployment
+
+Nuxt.js lets your choose between 2 modes to deploy your application: Server Rendered or Static Generated.
+
+### Server Rendered Deployment
+
+To deploy, instead of running nuxt, you probably want to build ahead of time. Therefore, building and starting are separate commands:
+
+```bash
+nuxt build
+nuxt start
+```
+
+The `package.json` like follows is recommended:
+```json
+{
+ "name": "my-app",
+ "dependencies": {
+ "nuxt": "latest"
+ },
+ "scripts": {
+ "dev": "nuxt",
+ "build": "nuxt build",
+ "start": "nuxt start"
+ }
+}
+```
+
+Note: we recommend putting `.nuxt` in `.npmignore` or `.gitignore`.
+
+### Static Generated Deployment
+
+Nuxt.js gives you the possibility to host your web application on any static hosting.
+
+To generate our web application into static files:
+
+```bash
+npm run generate
+```
+
+It will create a `dist` folder with everything inside ready to be deployed on a static hosting.
+
+If you have a project with [dynamic routes](/guide/routing#dynamic-routes), take a look at the [generate configuration](/api/configuration-generate) to tell nuxt.js how to generate these dynamic routes.
+
+
When generating your web application with `nuxt generate`, [the context](/api#context) given to [data()](/guide/async-data#the-data-method) and [fetch()](/guide/vuex-store#the-fetch-method) will not have `req` and `res`.
diff --git a/ja/guide/configuration.md b/ja/guide/configuration.md
new file mode 100644
index 000000000..4307a9a69
--- /dev/null
+++ b/ja/guide/configuration.md
@@ -0,0 +1,84 @@
+---
+title: Configuration
+description: The Nuxt.js default configuration covers most of usages. However, the nuxt.config.js file lets you overwrite it.
+---
+
+> The Nuxt.js default configuration covers most of usages. However, the nuxt.config.js file lets you overwrite it.
+
+### build
+
+This option lets you add modules inside the vendor.bundle.js file generated to reduce the size of the app bundle. It's really useful when using external modules
+
+[Documentation about build integration](/api/configuration-build)
+
+### cache
+
+This option lets you enable cached components for better render performances.
+
+[Documentation about cache integration](/api/configuration-cache)
+
+### css
+
+This option lets you define the CSS files/modules/libraries you want to set as globals (included in every pages).
+
+[Documentation about css integration](/api/configuration-css)
+
+### dev
+
+This option lets you define the development or production mode of nuxt.js
+
+[Documentation about dev integration](/api/configuration-dev)
+
+### env
+
+This option lets you define environment variables available both client and server side.
+
+[Documentation about env integration](/api/configuration-env)
+
+### generate
+
+This option lets you to define each params value for every dynamic routes in your application that Nuxt.js transforms into HTML files.
+
+[Documentation about generate integration](/api/configuration-generate)
+
+### head
+
+This option lets you to define all the defaults metas for your application.
+
+[Documentation about head integration](/api/configuration-head)
+
+### loading
+
+This option lets you to customize the loading component load by default with Nuxt.js.
+
+[Documentation about loading integration](/api/configuration-loading)
+
+### plugins
+
+This option lets you to define Javascript plugins to be ran before instantiating the root vue.js application.
+
+[Documentation about plugins integration](/api/configuration-plugins)
+
+### rootDir
+
+This option lets you define the workspace of your nuxt.js application.
+
+[Documentation about rootDir integration](/api/configuration-rootdir)
+
+### router
+
+This option lets you to overwrite the default Nuxt.js configuration of vue-router.
+
+[Documentation about router integration](/api/configuration-router)
+
+### srcDir
+
+This option lets you define the source directory of your nuxt.js application.
+
+[Documentation about srcDir integration](/api/configuration-srcdir)
+
+### transition
+
+This option lets you define the default properties of the pages transitions.
+
+[Documentation about transition integration](/api/configuration-transition)
diff --git a/ja/guide/contribution-guide.md b/ja/guide/contribution-guide.md
new file mode 100644
index 000000000..556b9f490
--- /dev/null
+++ b/ja/guide/contribution-guide.md
@@ -0,0 +1,19 @@
+---
+title: Contribution Guide
+description: Any contribution to Nuxt.js is more than welcome!
+---
+
+> Any contribution to Nuxt.js is more than welcome!
+
+## Reporting Issues
+
+A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written bug report, and will thank you for it! Before reporting an issue, please read carefully the documentation and search if any issue for your problem doesn't already exist: https://github.com/nuxt/nuxt.js/issues
+
+## Pull Requests
+
+We'd love to see your pull requests, even if it's just to fix a typo. Any significant improvement should be documented as [a GitHub issue](https://github.com/nuxt/nuxt.js/issues) before anybody starts working on it.
+
+### Convention
+
+- For a fix, the branch name should be `fix-XXX` where XXX is the issue number or the name of what your fix does
+- For a feature, the branch name should be `feature-XXX` where XXX is the issue number associated to this feature request
diff --git a/ja/guide/development-tools.md b/ja/guide/development-tools.md
new file mode 100644
index 000000000..0d1b745f5
--- /dev/null
+++ b/ja/guide/development-tools.md
@@ -0,0 +1,154 @@
+---
+title: Development Tools
+description: Nuxt.js helps you to make your web development enjoyable.
+---
+
+> Testing your application is part of the web development. Nuxt.js helps you to make it as easy as possible.
+
+## End-to-End Testing
+
+[Ava](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.
+
+First, we need to add ava and jsdom as development dependencies:
+```bash
+npm install --save-dev ava jsdom
+```
+
+And add a test script to our `package.json`:
+
+```javascript
+"scripts": {
+ "test": "ava",
+}
+```
+
+We are going to write our tests in the `test` folder:
+```bash
+mkdir test
+```
+
+Let's says we have a page in `pages/index.vue`:
+```html
+
+
Hello {{ name }}!
+
+
+
+
+
+```
+
+When we launch our app with `npm run dev` and open [http://localhost:3000](http://localhost:3000), we can see our red `Hello world!` title.
+
+We add our test file `test/index.test.js`:
+
+```js
+import test from 'ava'
+import Nuxt from 'nuxt'
+import { resolve } from 'path'
+
+// We keep the nuxt and server instance
+// So we can close them at the end of the test
+let nuxt = null
+let server = null
+
+// Init Nuxt.js and create a server listening on localhost:4000
+test.before('Init Nuxt.js', async t => {
+ const rootDir = resolve(__dirname, '..')
+ let config = {}
+ try { config = require(resolve(rootDir, 'nuxt.config.js')) } catch (e) {}
+ config.rootDir = rootDir // project folder
+ config.dev = false // production build
+ nuxt = new Nuxt(config)
+ await nuxt.build()
+ server = new nuxt.Server(nuxt)
+ server.listen(4000, 'localhost')
+})
+
+// Example of testing only generated html
+test('Route / exits and render HTML', async t => {
+ let context = {}
+ const { html } = await nuxt.renderRoute('/', context)
+ t.true(html.includes('
Hello world!
'))
+})
+
+// Example of testing via dom checking
+test('Route / exits and render HTML with CSS applied', async t => {
+ const window = await nuxt.renderAndGetWindow('http://localhost:4000/')
+ const element = window.document.querySelector('.red')
+ t.not(element, null)
+ t.is(element.textContent, 'Hello world!')
+ t.is(element.className, 'red')
+ t.is(window.getComputedStyle(element).color, 'red')
+})
+
+// Close server and ask nuxt to stop listening to file changes
+test.after('Closing server and nuxt.js', t => {
+ server.close()
+ nuxt.close()
+})
+```
+
+We can now launch our tests:
+```bash
+npm test
+```
+
+jsdom has some limitations because it does not use a browser. However, it will cover most of our tests. If you want to use a browser to test your application, you might want to check out [Nightwatch.js](http://nightwatchjs.org).
+
+## ESLint
+
+> ESLint is a great tool to keep your code clean
+
+You can add [ESLint](http://eslint.org) pretty easily with nuxt.js, first, you need to add the npm dependencies:
+
+```bash
+npm install --save-dev babel-eslint eslint eslint-config-standard eslint-plugin-html eslint-plugin-promise eslint-plugin-standard
+```
+
+Then, you can configure ESLint via a `.eslintrc.js` file in your root project directory:
+```js
+module.exports = {
+ root: true,
+ parser: 'babel-eslint',
+ env: {
+ browser: true,
+ node: true
+ },
+ extends: 'standard',
+ // required to lint *.vue files
+ plugins: [
+ 'html'
+ ],
+ // add your custom rules here
+ rules: {},
+ globals: {}
+}
+```
+
+Then, you can add a `lint` script in your `package.json`:
+
+```js
+"scripts": {
+ "lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
+}
+```
+
+You can now launch:
+```bash
+npm run lint
+```
+
+ESLint will lint every of your JavaScript and Vue files while ignoring your ignored files defined in your `.gitignore`.
+
+
One best practice is to add also `"precommit": "npm run lint"` in your package.json to lint your code automatically before commiting your code.
diff --git a/ja/guide/directory-structure.md b/ja/guide/directory-structure.md
new file mode 100644
index 000000000..e3996480e
--- /dev/null
+++ b/ja/guide/directory-structure.md
@@ -0,0 +1,94 @@
+---
+title: Directory Structure
+description: The default Nuxt.js application structure is intended to provide a great starting point for both large and small applications.
+---
+
+> The default Nuxt.js application structure is intended to provide a great starting point for both small and large applications. Of course, you are free to organize your application however you like.
+
+## Directories
+
+### The Assets Directory
+
+The `assets` directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
+
+[More documentation about Assets integration](/guide/assets)
+
+### The Components Directory
+
+The `components` directory contains your Vue.js Components. Nuxt.js doesn't supercharge the data method on these components.
+
+### The Layouts Directory
+
+The `layouts` directory contains your Application Layouts.
+
+_This directory can not be renamed._
+
+[More documentation about Layouts integration](/guide/views#layouts)
+
+### The Middleware Directory
+
+_Coming soon_
+
+### The Pages Directory
+
+The `pages` directory contains your Application Views and Routes. The framework reads all the `.vue` files inside this directory and create the router of your application.
+
+_This directory can not be renamed._
+
+[More documentation about Pages integration](/guide/views)
+
+### The Plugins Directory
+
+The `plugins` directory contains your Javascript plugins that you want to run before instantiating the root vue.js application.
+
+[More documentation about Plugins integration](/guide/plugins)
+
+### The Static Directory
+
+The `static` directory contains your static files. Each files inside this directory is mapped to /.
+
+**Example:** /static/robots.txt is mapped as /robots.txt
+
+_This directory can not be renamed._
+
+[More documentation about Static integration](/guide/assets#static)
+
+### The Store Directory
+
+The `store` directory contains your [Vuex Store](http://vuex.vuejs.org) files. Vuex Store option is implemented in the Nuxt.js framework. Creating a `index.js` file in this directory activate the option in the framework automatically.
+
+_This directory can not be renamed._
+
+[More documentation about Store integration](/guide/vuex-store)
+
+### The nuxt.config.js File
+
+The `nuxt.config.js` file contains your Nuxt.js custom configuration.
+
+_This file can not be renamed._
+
+[More documentation about nuxt.config.js integration](/guide/configuration)
+
+### The package.json File
+
+The `package.json` file contains your Application dependencies and scripts.
+
+_This file can not be renamed._
+
+## Aliases
+
+| Alias | Directory |
+|-----|------|
+| ~ | / |
+| ~assets | /assets |
+| ~components | /components |
+| ~pages | /pages |
+| ~plugins | /plugins |
+| ~static | /static |
+
+Aliases which link to files:
+
+| Alias | Usage | Description |
+|-------|------|--------------|
+| ~store | `const store = require('~store')` | Import the `vuex` store instance. |
+| ~router | `const router = require('~router')`| Import the `vue-router` instance. |
diff --git a/ja/guide/index.md b/ja/guide/index.md
new file mode 100644
index 000000000..04f7c0057
--- /dev/null
+++ b/ja/guide/index.md
@@ -0,0 +1,102 @@
+---
+title: Introduction
+description: "The 25th of October 2016, the team behind zeit.co, announced Next.js, a framework for server-rendered React applications. Few hours after the announcement, the idea of creating server-rendered Vue.js applications the same way as Next.js was obvious: Nuxt.js was born."
+---
+
+> The 25th of October 2016, the team behind [zeit.co](https://zeit.co/), announced [Next.js](https://zeit.co/blog/next), a framework for server-rendered React applications. Few hours after the announcement, the idea of creating server-rendered [Vue.js](https://vuejs.org) applications the same way as Next.js was obvious: **Nuxt.js** was born.
+
+## What is Nuxt.js ?
+
+Nuxt.js is a framework for creating Universal Vue.js Applications.
+
+Its main scope is **UI rendering** while abstracting away the client/server distribution.
+
+Our goal is to create a framework flexible enough so that you can use it as a main project base or in addition to your current project based on Node.js.
+
+Nuxt.js presets all the configuration needed to make your development of a Vue.js Application **Server Rendered** more enjoyable.
+
+In addition, we also provide another deployment option called: *nuxt generate*. It will build a **Static Generated** Vue.js Application.
+We believe that option could be the next big step in the development of Web Applications with microservices.
+
+As a framework, Nuxt.js comes with a lot of features to help you in your development between the client side and the server side such as Asynchronous Data, Middleware, Layouts, etc.
+
+## How it Works
+
+
+
+Nuxt.js includes the following to create a rich web application development:
+- [Vue 2](https://github.com/vuejs/vue)
+- [Vue-Router](https://github.com/vuejs/vue-router)
+- [Vuex](https://github.com/vuejs/vuex) (included only when using the [store option](/guide/vuex-store))
+- [Vue-Meta](https://github.com/declandewet/vue-meta)
+
+A total of only **28kb min+gzip** (31kb with vuex).
+
+Under the hood we use [Webpack](https://github.com/webpack/webpack) with [vue-Loader](https://github.com/vuejs/vue-loader) and [babel-loader](https://github.com/babel/babel-loader) to bundle, code-split and minify your code.
+
+## Features
+
+- Write Vue Files
+- Automatic Code Splitting
+- Server-Side Rendering
+- Powerful Routing System with Asynchronous Data
+- Static File Serving
+- ES6/ES7 Transpilation
+- Bundling and minifying of your JS & CSS
+- Managing Head Elements
+- Hot reloading in Development
+- Pre-processor: SASS, LESS, Stylus, etc
+
+## Schema
+
+This schema shows what is called by nuxt.js when the server is called or when the user navigate through the app via ``:
+
+
+
+## Server Rendered
+
+You can use nuxt.js as a framework to handle all the UI rendering of your project.
+
+When launching `nuxt`, it will start a development server with hot-reloading and vue-server-renderer configured to automatically server-render your application.
+
+Take a look at [the commands](/guide/commands) to learn more about it.
+
+If you already have a server, you can plug nuxt.js by using it as a middleware, there is no restriction at all when using nuxt.js for developing your Universal Web Applications, see the [Using Nuxt.js Programmatically](/api/nuxt) guide.
+
+## Static Generated
+
+The big innovation of nuxt.js comes here: `nuxt generate`
+
+When building your application it will generate the HTML of every of your routes to store it in a file.
+
+Example:
+
+```bash
+-| pages/
+----| about.vue
+----| index.vue
+```
+
+Will generate:
+```
+-| dist/
+----| about/
+------| index.html
+----| index.html
+```
+
+This way, you can host your generated web application on any static hosting!
+
+The best example is this website. It is generated and hosted on Github Pages:
+- [Source code](https://github.com/nuxt/nuxtjs.org)
+- [Generated code](https://github.com/nuxt/nuxtjs.org/tree/gh-pages)
+
+We don't want to manually generate the application every time we update the [docs repository](https://github.com/nuxt/docs), so each push made calls an AWS Lambda function which:
+1. Clone the [nuxtjs.org repository](https://github.com/nuxt/nuxtjs.org)
+2. Install the dependencies via `npm install`
+3. Run `nuxt generate`
+4. Push the `dist` folder to the `gh-pages` branch
+
+We now have a **Serverless Static Generated Web Application** :)
+
+We can go further by thinking of an e-commerce web application made with `nuxt generate` and hosted on a CDN, and every time a product is out of stock or back in stock, we regenerate the web app. But if the user navigates through the web app in the meantime, it will be up to date thanks to the API calls made to the e-commerce API. No need to have multiple instances of a server + a cache anymore!
diff --git a/ja/guide/installation.md b/ja/guide/installation.md
new file mode 100644
index 000000000..f20967e37
--- /dev/null
+++ b/ja/guide/installation.md
@@ -0,0 +1,92 @@
+---
+title: Installation
+description: Nuxt.js is really easy to get started with. A simple project only need the `nuxt` dependency.
+---
+
+> Nuxt.js is really easy to get started with. A simple project only need the `nuxt` dependency.
+
+## Using Nuxt.js starter template
+
+To start quickly, the Nuxt.js team has created a [starter template](https://github.com/nuxt/starter).
+
+[Download the .zip](https://github.com/nuxt/starter/archive/source.zip) starter template or install it with vue-cli:
+
+```bash
+$ vue init nuxt/starter
+```
+
+> If [vue-cli](https://github.com/vuejs/vue-cli) is not installed, please install it with `npm install -g vue-cli`
+
+then install the dependencies:
+
+```bash
+$ cd
+$ npm install
+```
+
+and launch the project with:
+```bash
+$ npm run dev
+```
+The application is now running on http://localhost:3000
+
+
Nuxt.js will listen on the files changes inside the `pages` directory, so no need to restart the application when adding new pages
+
+To discover more about the directory structure of the project: [Directory Structure Documentation](/guide/directory-structure).
+
+## Starting from scratch
+
+Creating a Nuxt.js application from scratch is also really easy, it only needs *1 file and 1 directory*. Let's create an empty directory to start working on the application:
+
+```bash
+$ mkdir
+$ cd
+```
+
+*Info: replace project-name by the name of the project.*
+
+### The package.json
+
+The project needs a `package.json` file to specify how to start `nuxt`:
+```json
+{
+ "name": "my-app",
+ "scripts": {
+ "dev": "nuxt"
+ }
+}
+```
+`scripts` will launch Nuxt.js via `npm run dev`.
+
+### Installing `nuxt`
+
+Once the `package.json` has been created, add `nuxt` to the project via NPM:
+```bash
+npm install --save nuxt
+```
+
+### The `pages` directory
+
+Nuxt.js will transform every `*.vue` file inside the `pages` directory as a route for the application.
+
+Create the `pages` directory:
+```bash
+$ mkdir pages
+```
+
+then create the first page in `pages/index.vue`:
+```html
+
+
Hello world!
+
+```
+
+and launch the project with:
+```bash
+$ npm run dev
+```
+The application is now running on http://localhost:3000
+
+
Nuxt.js will listen on the files changes inside the `pages` directory, so no need to restart the application when adding new pages
It is important to know that in any Vue [instance lifecycle](https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram), only `beforeCreate` and `created` hooks are called **both from client-side and server-side**. All other hooks are called only from the client-side.
+
+## External Packages
+
+We may want to use external packages/modules in our application, one great example is [axios](https://github.com/mzabriskie/axios) for making HTTP request for both server and client.
+
+We install it via NPM:
+
+```bash
+npm install --save axios
+```
+
+Then, we can use it directly in our pages:
+
+```html
+
+
{{ title }}
+
+
+
+```
+
+But there is **one problem here**, if we import axios in another page, it will be included again for the page bundle. We want to include `axios` only once in our application, for this, we use the `build.vendor` key in our `nuxt.config.js`:
+
+```js
+module.exports = {
+ build: {
+ vendor: ['axios']
+ }
+}
+```
+
+Then, I can import `axios` anywhere without having to worry about making the bundle bigger!
+
+## Vue Plugins
+
+If we want to use [vue-notifications](https://github.com/se-panfilov/vue-notifications) to display notification in our application, we need to setup the plugin before launching the app.
+
+File `plugins/vue-notifications.js`:
+```js
+import Vue from 'vue'
+import VueNotifications from 'vue-notifications'
+
+Vue.use(VueNotifications)
+```
+
+Then, we add the file inside the `plugins` key of `nuxt.config.js`:
+```js
+module.exports = {
+ plugins: ['~plugins/vue-notifications']
+}
+```
+
+To learn more about the `plugins` configuration key, check out the [plugins api](/api/configuration-plugins).
+
+Actually, `vue-notifications` will be included in the app bundle, but because it's a library, we want to include it in the vendor bundle for better caching.
+
+We can update our `nuxt.config.js` to add `vue-notifications` in the vendor bundle:
+```js
+module.exports = {
+ build: {
+ vendor: ['vue-notifications']
+ },
+ plugins: ['~plugins/vue-notifications']
+}
+```
+
+## Client-side only
+
+Some plugins might work **only for the browser**, you can use the `process.BROWSER_BUILD` variable to check if the plugin will run from the client-side.
+
+Example:
+```js
+import Vue from 'vue'
+import VueNotifications from 'vue-notifications'
+
+if (process.BROWSER_BUILD) {
+ Vue.use(VueNotifications)
+}
+```
+
+In case you need to require some libraries only for the server, you can use the `process.SERVER_BUILD` variable set to `true` when webpack is creating the `server.bundle.js` file.
diff --git a/ja/guide/routing.md b/ja/guide/routing.md
new file mode 100644
index 000000000..cbfbe464c
--- /dev/null
+++ b/ja/guide/routing.md
@@ -0,0 +1,311 @@
+---
+title: Routing
+description: Nuxt.js use the file-system to generate the routes of your web applications, it's as simple as PHP to create routes.
+---
+
+> Nuxt.js generates automatically the [vue-router](https://github.com/vuejs/vue-router) configuration according to your file tree of Vue files inside the `pages` directory.
+
+## Basic Routes
+
+This file tree:
+
+```bash
+pages/
+--| user/
+-----| index.vue
+-----| one.vue
+--| index.vue
+```
+
+will automatically generate:
+
+```js
+router: {
+ routes: [
+ {
+ name: 'index',
+ path: '/',
+ component: 'pages/index.vue'
+ },
+ {
+ name: 'user',
+ path: '/user',
+ component: 'pages/user/index.vue'
+ },
+ {
+ name: 'user-one',
+ path: '/user/one',
+ component: 'pages/user/one.vue'
+ }
+ ]
+}
+```
+
+## Dynamic Routes
+
+To define a dynamic route with a param, you need to define a .vue file OR a directory **prefixed by an underscore**.
+
+This file tree:
+
+```bash
+pages/
+--| _slug/
+-----| comments.vue
+-----| index.vue
+--| users/
+-----| _id.vue
+--| index.vue
+```
+
+will automatically generate:
+
+```js
+router: {
+ routes: [
+ {
+ name: 'index',
+ path: '/',
+ component: 'pages/index.vue'
+ },
+ {
+ name: 'users-id',
+ path: '/users/:id?',
+ component: 'pages/users/_id.vue'
+ },
+ {
+ name: 'slug',
+ path: '/:slug',
+ component: 'pages/_slug/index.vue'
+ },
+ {
+ name: 'slug-comments',
+ path: '/:slug/comments',
+ component: 'pages/_slug/comments.vue'
+ }
+ ]
+}
+```
+
+As you can see the route named `users-id` has the path `:id?` which makes it optional, if you want to make it required, create an `index.vue` file in the `users` directory.
+
+### Validate Route Params
+
+Nuxt.js lets you define a validator method inside your dynamic route component.
+
+In this example: `pages/users/_id.vue`
+
+```js
+export default {
+ validate ({ params }) {
+ // Must be a number
+ return /^\d+$/.test(params.id)
+ }
+}
+```
+
+If the validate method does not return `true`, Nuxt.js will automatically load the 404 error page.
+
+More information about the validate method: [API Pages validate](/api/pages-validate)
+
+## Nested Routes
+
+Nuxt.js lets you create nested route by using the children routes of vue-router.
+
+To define a nested route, you need to create a Vue file with the **same name as the directory** which contain your children views.
+
+
Don't forget to write `` inside the parent component (.vue file).
+
+To add a fade transition to every page of your application, we need a CSS file that is shared across all our routes, so we start by creating a file in the `assets` folder.
+
+Our global css in `assets/main.css`:
+```css
+.page-enter-active, .page-leave-active {
+ transition: opacity .5s;
+}
+.page-enter, .page-leave-active {
+ opacity: 0;
+}
+```
+
+We add its path in our `nuxt.config.js` file:
+```js
+module.exports = {
+ css: [
+ 'assets/main.css'
+ ]
+}
+```
+
+More information about the transition key: [API Configuration transition](/api/pages-transition)
+
+### Page Settings
+
+You can also define a custom transition for only one page with the `transition` property.
+
+We add a new class in our global css in `assets/main.css`:
+```css
+.test-enter-active, .test-leave-active {
+ transition: opacity .5s;
+}
+.test-enter, .test-leave-active {
+ opacity: 0;
+}
+```
+
+then, we use the transition property to define the class name to use for this page transition:
+```js
+export default {
+ transition: 'test'
+}
+```
+
+More information about the transition property: [API Pages transition](/api/pages-transition)
+
+## Middleware
+
+> The middleware lets you define custom function to be ran before rendering a page or a group of pages.
+
+**Every middleware should be placed in the `middleware/` directory.** The filename will be the name of the middleware (`middleware/auth.js` will be the `auth` middleware).
+
+A middleware receive [the context](/api#the-context) as first argument:
+
+```js
+export default function (context) {
+ context.userAgent = context.isServer ? context.req.headers['user-agent'] : navigator.userAgent
+}
+```
+
+The middleware will be executed in series in this order:
+1. `nuxt.config.js`
+2. Matched layouts
+3. Matched pages
+
+A middleware can be asynchronous, simply return a `Promise` or use the 2nd `callback` argument:
+
+`middleware/stats.js`
+```js
+import axios from 'axios'
+
+export default function ({ route }) {
+ return axios.post('http://my-stats-api.com', {
+ url: route.fullPath
+ })
+}
+```
+
+Then, in your `nuxt.config.js`, layout or page, use the `middleware` key:
+
+`nuxt.config.js`
+```js
+module.exports = {
+ router: {
+ middleware: 'stats'
+ }
+}
+```
+
+The `stats` middleware will be called for every route changes.
+
+To see a real-life example using the middleware, please see [example-auth0](https://github.com/nuxt/example-auth0) on GitHub.
diff --git a/ja/guide/views.md b/ja/guide/views.md
new file mode 100644
index 000000000..a65de291f
--- /dev/null
+++ b/ja/guide/views.md
@@ -0,0 +1,165 @@
+---
+title: Views
+description: The Views section describes all you need to configure data and views for a specific route in your Nuxt.js application. (Pages, layouts and HTML Head)
+---
+
+> The Views section describes all you need to configure data and views for a specific route in your Nuxt.js application. (Pages, layouts and HTML Head)
+
+## Pages
+
+Every Page component is a Vue component, but Nuxt.js adds special keys to make the development of your universal application the easiest way possible.
+
+```html
+
+
Hello {{ name }}!
+
+
+
+
+
+```
+
+
+| Attribute | Description |
+|-----------|-------------|
+| data | The most important key, it has the same purpose as [Vue data](https://vuejs.org/v2/api/#Options-Data) but it can be asynchronous and receives the context as argument, please read the [async data documentation](/guide/async-data) to learn how it works. |
+| fetch | Used to fill the store before rendering the page, it's like the data method except it doesn't set the component data. See the [API Pages fetch documentation](/api/pages-fetch). |
+| head | Set specific Meta Tags for the current page, see [API Pages head documentation](/api/pages-head). |
+| layout | Specify a layout defined in the `layouts` directory, see [API Pages layouts documentation](/api/pages-layout). |
+| transition | Set a specific transition for the page, see [API Pages transition](/api/pages-transition). |
+| scrollToTop | Boolean, by default: `false`. Specify if you want the page to scroll to the top before rendering the page, it's used for [nested routes](/guide/routing#nested-routes). |
+| validate | Validator function for a [dynamic route](/guide/routing#dynamic-routes). |
+| middleware | Set a middleware for this page, the middleware will be called before rendering the page, see [routes middleware](/guide/routing#middleware). |
+
+More information about the pages properties usage: [API Pages](/api)
+
+## Layouts
+
+Nuxt.js lets you extend the main layout or create custom layouts by adding them in the `layouts` directory.
+
+### Default Layout
+
+You can extend the main layout by adding a `layouts/default.vue` file.
+
+*Make sure to add the `` component when creating a layout to display the page component.*
+
+The default layout source code is:
+```html
+
+
+
+```
+
+### Error Page
+
+You can customize the error page by adding a `layouts/error.vue` file.
+
+This layout is special since you should not include `` inside its template. You must see this layout as a component displayed when an error occurs (404, 500, etc).
+
+The default error page source code is [available on Github](https://github.com/nuxt/nuxt.js/blob/master/lib/app/components/nuxt-error.vue).
+
+Example of a custom error page in `layouts/error.vue`:
+```html
+
+
+
Page not found
+
An error occurred
+ Home page
+
+
+
+
+```
+
+### Custom Layout
+
+Every file (*first level*) in the `layouts` directory will create a custom layout accessible with the `layout` property in the page component.
+
+*Make sure to add the `` component when creating a layout to display the page component.*
+
+Example of `layouts/blog.vue`:
+```html
+
+
+
My blog navigation bar here
+
+
+
+```
+
+And then in `pages/posts.vue`, you can tell Nuxt.js to use your custom layout:
+```html
+
+```
+
+More information about the layout property: [API Pages layout](/api/pages-layout)
+
+Check the [demonstration video](https://www.youtube.com/watch?v=YOKnSTp7d38) to see it in action.
+
+## HTML Head
+
+Nuxt.js uses [vue-meta](https://github.com/declandewet/vue-meta) to update the `headers` and `html attributes` of your application.
+
+Nuxt.js configures `vue-meta` with these options:
+```js
+{
+ keyName: 'head', // the component option name that vue-meta looks for meta info on.
+ attribute: 'n-head', // the attribute name vue-meta adds to the tags it observes
+ ssrAttribute: 'n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
+ tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
+}
+```
+
+### Default Meta Tags
+
+Nuxt.js let you define all default meta for your application inside `nuxt.config.js`, use the same `head` property:
+
+Example of a custom viewport with a custom Google font:
+```js
+head: {
+ meta: [
+ { charset: 'utf-8' },
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' }
+ ],
+ link: [
+ { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Roboto' }
+ ]
+}
+```
+
+To know the list of options you can give to `head`, take a look at [vue-meta documentation](https://github.com/declandewet/vue-meta#recognized-metainfo-properties).
+
+More information about the head method: [API Configuration head](/api/configuration-head)
+
+### Custom Meta Tags for a Page
+
+More information about the head method: [API Pages head](/api/pages-head)
+
+
To avoid any duplication when used in child component, please give a unique identifier with the `hid` key, please [read more about it](https://github.com/declandewet/vue-meta#lists-of-tags).
diff --git a/ja/guide/vuex-store.md b/ja/guide/vuex-store.md
new file mode 100644
index 000000000..6e87670e0
--- /dev/null
+++ b/ja/guide/vuex-store.md
@@ -0,0 +1,189 @@
+---
+title: Vuex Store
+description: Using a store to manage the state is important for every big application, that's why nuxt.js implement Vuex in its core.
+---
+
+> Using a store to manage the state is important to every big application, that's why nuxt.js implement [vuex](https://github.com/vuejs/vuex) in its core.
+
+## Activate the Store
+
+Nuxt.js will look for the `store` directory, if it exists, it will:
+
+1. Import Vuex
+2. Add `vuex` module in the vendors bundle
+3. Add the `store` option to the root `Vue` instance.
+
+Nuxt.js lets you have **2 modes of store**, choose the one you prefer:
+- **Classic:** `store/index.js` returns a store instance
+- **Modules:** every `.js` file inside the `store` directory is transformed as a [namespaced module](http://vuex.vuejs.org/en/modules.html) (`index` being the root module)
+
+## Classic mode
+
+To activate the store with the classic mode, we create the `store/index.js` file and export the store instance:
+
+```js
+import Vuex from 'vuex'
+
+const store = new Vuex.Store({
+ state: {
+ counter: 0
+ },
+ mutations: {
+ increment (state) {
+ state.counter++
+ }
+ }
+})
+
+export default store
+```
+
+> We don't need to install `vuex` since it's shipped with nuxt.js
+
+We can now use `this.$store` inside our components:
+
+```html
+
+
+
+```
+
+## Modules mode
+
+> Nuxt.js lets you have a `store` directory with every file corresponding to a module.
+
+If you want this option, export the state, mutations and actions in `store/index.js` instead of a store instance:
+
+```js
+export const state = {
+ counter: 0
+}
+
+export const mutations = {
+ increment (state) {
+ state.counter++
+ }
+}
+```
+
+Then, you can have a `store/todos.js` file:
+```js
+export const state = {
+ list: []
+}
+
+export const mutations = {
+ add (state, text) {
+ state.list.push({
+ text: text,
+ done: false
+ })
+ },
+ delete (state, { todo }) {
+ state.list.splice(state.list.indexOf(todo), 1)
+ },
+ toggle (state, todo) {
+ todo.done = !todo.done
+ }
+}
+```
+
+The store will be as such:
+```js
+new Vuex.Store({
+ state: { counter: 0 },
+ mutations: {
+ increment (state) {
+ state.counter++
+ }
+ },
+ modules: {
+ todos: {
+ state: {
+ list: []
+ },
+ mutations: {
+ add (state, { text }) {
+ state.list.push({
+ text,
+ done: false
+ })
+ },
+ delete (state, { todo }) {
+ state.list.splice(state.list.indexOf(todo), 1)
+ },
+ toggle (state, { todo }) {
+ todo.done = !todo.done
+ }
+ }
+ }
+ }
+})
+```
+
+And in your `pages/todos.vue`, using the `todos` module:
+
+```html
+
+
+
+
+ {{ todo.text }}
+
+
+
+
+
+
+
+
+```
+
+
You can also have modules by exporting a store instance, you will have to add them manually on your store.
+
+## The fetch Method
+
+> The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+
+More information about the fetch method: [API Pages fetch](/api/pages-fetch)
+
+## The nuxtServerInit Action
+
+If the action `nuxtServerInit` is defined in the store, nuxt.js will call it with the context (only from the server-side). It's useful when we have some data on the server we want to give directly to the client-side.
+
+For example, let's say we have sessions on the server-side and we can access the connected user trough `req.session.user`. To give the authenticated user to our store, we update our `store/index.js` to the following:
+
+```js
+actions: {
+ nuxtServerInit ({ commit }, { req }) {
+ if (req.session.user) {
+ commit('user', req.session.user)
+ }
+ }
+}
+```
+
+> If you are using the _Modules_ mode of the Vuex store, only the primary module (in `store/index.js`) will receive this action. You'll need to chain your module actions from there.
+
+The context is given to `nuxtServerInit` as the 2nd argument, it is the same as the `data` or `fetch` method except that `context.redirect()` and `context.error()` are omitted.
diff --git a/ja/lang.json b/ja/lang.json
new file mode 100644
index 000000000..013f5bf5a
--- /dev/null
+++ b/ja/lang.json
@@ -0,0 +1,50 @@
+{
+ "iso": "en",
+ "links": {
+ "api": "API",
+ "blog": "Blog",
+ "chat": "Chat",
+ "documentation": "Documentation",
+ "download": "Download",
+ "examples": "Examples",
+ "ecosystem": "Ecosystem",
+ "faq": "FAQ",
+ "get_started": "get started",
+ "github": "Github",
+ "guide": "Guide",
+ "homepage": "Home page",
+ "live_demo": "Live Demo",
+ "live_edit": "Live Edit",
+ "twitter": "Twitter",
+ "vuejs": "Vue.js",
+ "vue_jobs": "Vue Jobs"
+ },
+ "text": {
+ "an_error_occured": "An error occured",
+ "api_page_not_found": "API page not found",
+ "example_file": "Example Files",
+ "please_wait": "Please wait...",
+ "please_define_title": "Please define a title in the front matter",
+ "please_define_description": "Please define a description in the front matter",
+ "search": "Search",
+ "version": "Version"
+ },
+ "homepage": {
+ "title": "Universal Vue.js Applications",
+ "meta": {
+ "title": "Nuxt.js - Universal Vue.js Applications",
+ "description": "Nuxt.js is a minimal framework for creating Vue.js applications with server side rendering, code-splitting, hot-reloading, static generation and more!"
+ }
+ },
+ "footer": {
+ "authors": "Made by Chopin Brothers"
+ },
+ "guide": {
+ "release_notes": "Release Notes",
+ "contribute": "Caught a mistake or want to contribute to the documentation?",
+ "edit_on_github": "Edit this page on Github!"
+ },
+ "examples": {
+ "source_code": "Source Code"
+ }
+}
From ab4a0d652fc46ee93a4aea172dca9b653c139357 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Sun, 19 Feb 2017 22:35:44 +0900
Subject: [PATCH 002/129] Translate ja/lang.json
---
ja/lang.json | 52 ++++++++++++++++++++++++++--------------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/ja/lang.json b/ja/lang.json
index 013f5bf5a..d7f32a139 100644
--- a/ja/lang.json
+++ b/ja/lang.json
@@ -1,50 +1,50 @@
{
- "iso": "en",
+ "iso": "ja",
"links": {
"api": "API",
- "blog": "Blog",
- "chat": "Chat",
- "documentation": "Documentation",
- "download": "Download",
- "examples": "Examples",
- "ecosystem": "Ecosystem",
+ "blog": "ブログ",
+ "chat": "チャット",
+ "documentation": "ドキュメント",
+ "download": "ダウンロード",
+ "examples": "例",
+ "ecosystem": "エコシステム",
"faq": "FAQ",
- "get_started": "get started",
+ "get_started": "はじめる",
"github": "Github",
"guide": "Guide",
- "homepage": "Home page",
- "live_demo": "Live Demo",
- "live_edit": "Live Edit",
+ "homepage": "ホームページ",
+ "live_demo": "ライブデモ",
+ "live_edit": "ライブエディット",
"twitter": "Twitter",
"vuejs": "Vue.js",
"vue_jobs": "Vue Jobs"
},
"text": {
- "an_error_occured": "An error occured",
- "api_page_not_found": "API page not found",
- "example_file": "Example Files",
- "please_wait": "Please wait...",
- "please_define_title": "Please define a title in the front matter",
- "please_define_description": "Please define a description in the front matter",
- "search": "Search",
- "version": "Version"
+ "an_error_occured": "エラーが発生しました",
+ "api_page_not_found": "API ページが見つかりません",
+ "example_file": "サンプルファイル",
+ "please_wait": "お待ちください...",
+ "please_define_title": "Frontmatter 内の title を定義してください",
+ "please_define_description": "Frontmatter 内の description を定義してください",
+ "search": "検索",
+ "version": "バージョン"
},
"homepage": {
- "title": "Universal Vue.js Applications",
+ "title": "ユニバーサル Vue.js アプリケーション",
"meta": {
- "title": "Nuxt.js - Universal Vue.js Applications",
- "description": "Nuxt.js is a minimal framework for creating Vue.js applications with server side rendering, code-splitting, hot-reloading, static generation and more!"
+ "title": "Nuxt.js - ユニバーサル Vue.js アプリケーション",
+ "description": "Nuxt.js はサーバーサイドレンダリングやコード分割、ホットリローディング、静的なファイル生成などを備えた Vue.js アプリケーションを構築するためのミニマルなフレームワークです!"
}
},
"footer": {
"authors": "Made by Chopin Brothers"
},
"guide": {
- "release_notes": "Release Notes",
- "contribute": "Caught a mistake or want to contribute to the documentation?",
- "edit_on_github": "Edit this page on Github!"
+ "release_notes": "リリースノート",
+ "contribute": "間違いを見つけた、またはドキュメントに貢献したいですか?",
+ "edit_on_github": "GitHub でこのページを編集する"
},
"examples": {
- "source_code": "Source Code"
+ "source_code": "ソースコード"
}
}
From f1abd2a9b4c08ecc5cf81245947e16ff68038067 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Sun, 19 Feb 2017 22:36:22 +0900
Subject: [PATCH 003/129] Translate ja/guide/index.md
---
ja/guide/index.md | 186 +++++++++++++++++++++++++++++++++-------------
1 file changed, 136 insertions(+), 50 deletions(-)
diff --git a/ja/guide/index.md b/ja/guide/index.md
index 04f7c0057..c2967d12b 100644
--- a/ja/guide/index.md
+++ b/ja/guide/index.md
@@ -1,75 +1,138 @@
---
-title: Introduction
-description: "The 25th of October 2016, the team behind zeit.co, announced Next.js, a framework for server-rendered React applications. Few hours after the announcement, the idea of creating server-rendered Vue.js applications the same way as Next.js was obvious: Nuxt.js was born."
+title: はじめに
+description: "2016年10月25日 zeit.co のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク Next.js を発表しました。そしてその発表から数時間後、Next.js と同じやり方で Vue.js をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち Nuxt.js の誕生です。"
---
-> The 25th of October 2016, the team behind [zeit.co](https://zeit.co/), announced [Next.js](https://zeit.co/blog/next), a framework for server-rendered React applications. Few hours after the announcement, the idea of creating server-rendered [Vue.js](https://vuejs.org) applications the same way as Next.js was obvious: **Nuxt.js** was born.
+
+
-## What is Nuxt.js ?
+
-Nuxt.js is a framework for creating Universal Vue.js Applications.
+> 2016年10月25日、[zeit.co](https://zeit.co/) のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク [Next.js](https://zeit.co/blog/next) を発表しました。そしてその発表からわずか数時間後、Next.js と同じやり方で [Vue.js](https://vuejs.org) をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち **Nuxt.js** の誕生です。
-Its main scope is **UI rendering** while abstracting away the client/server distribution.
+
-Our goal is to create a framework flexible enough so that you can use it as a main project base or in addition to your current project based on Node.js.
+## Nuxt.js とは何ですか?
-Nuxt.js presets all the configuration needed to make your development of a Vue.js Application **Server Rendered** more enjoyable.
+
-In addition, we also provide another deployment option called: *nuxt generate*. It will build a **Static Generated** Vue.js Application.
-We believe that option could be the next big step in the development of Web Applications with microservices.
+Next.js とはユニバーサルな Vue.js アプリケーションを構築するためのフレームワークです。
-As a framework, Nuxt.js comes with a lot of features to help you in your development between the client side and the server side such as Asynchronous Data, Middleware, Layouts, etc.
+
-## How it Works
+クライアントサイドとサーバーサイドのディストリビューションを抽象化する間の **UI レンダリング** に焦点を当てています。
+
+
+
+私たちのゴールは、あるプロジェクトの基礎として利用したり、あるいは既に進行中の Node.js ベースのプロジェクトに追加するために十分に柔軟なフレームワークを作成することです。
+
+
+
+Nuxt.js は **サーバーサイドレンダリング** する Vue.js アプリケーションの開発をもっと楽しくするために必要な全ての設定をあらかじめ用意しています。
+
+
+
+
+それに加えて、*nuxt genrate* と呼ばれる別の開発オプションも提供します。これは **静的に生成された** Vue.js アプリケーションを構築するためのものです。私たちはこのオプションが、マイクロサービスでウェブアプリケーションを開発するための次の大きな一歩になり得ると信じています。
+
+
+
+Nuxt.js はフレームワークとして、クライアントサイドとサーバーサイド間にまたがる開発を手助けするたくさんの機能を備えています。例えば、同期でのデータをやり取りや、ミドルウェアやレイアウトなどです。
+
+
+
+## どのように動作するか?

-Nuxt.js includes the following to create a rich web application development:
+
+
+Nuxt.js はリッチなウェブアプリケーションを構築するために下記のものを含んでいます:
+
- [Vue 2](https://github.com/vuejs/vue)
- [Vue-Router](https://github.com/vuejs/vue-router)
-- [Vuex](https://github.com/vuejs/vuex) (included only when using the [store option](/guide/vuex-store))
+- [Vuex](https://github.com/vuejs/vuex)([store option](/guide/vuex-store) を利用しているときに限ります)
- [Vue-Meta](https://github.com/declandewet/vue-meta)
-A total of only **28kb min+gzip** (31kb with vuex).
+
+
+すべて合わせてもわずか **28kb min+gzip** です(Vuex 利用時は 31kb)
+
+
+
+また、バンドルやコード分割及びミニファイするために [Webpack](https://github.com/webpack/webpack) を [vue-Loader](https://github.com/vuejs/vue-loader) と [babel-loader](https://github.com/babel/babel-loader) と合わせて使います。
-Under the hood we use [Webpack](https://github.com/webpack/webpack) with [vue-Loader](https://github.com/vuejs/vue-loader) and [babel-loader](https://github.com/babel/babel-loader) to bundle, code-split and minify your code.
+
-## Features
+## 主な機能
-- Write Vue Files
-- Automatic Code Splitting
-- Server-Side Rendering
-- Powerful Routing System with Asynchronous Data
-- Static File Serving
-- ES6/ES7 Transpilation
-- Bundling and minifying of your JS & CSS
-- Managing Head Elements
-- Hot reloading in Development
-- Pre-processor: SASS, LESS, Stylus, etc
+
+
+
+
+
+
+
+
+
+
-## Schema
+- Vue ファイルで記述できること
+- コードの自動分割
+- サーバーサイドレンダリング
+- 非同期データを伴うパワフルなルーティング
+- 静的なファイル配信
+- ES6/ES7 のトランスパイレーション
+- JS と CSS のバンドル及びミニファイ
+- Head タグ(訳注: メタタグ)の管理
+- 開発モードにおけるホットリローディング
+- SASS, LESS, Stylus などのプリプロセッサのサポート
-This schema shows what is called by nuxt.js when the server is called or when the user navigate through the app via ``:
+
+
+## 図解
+
+
+
+下の図は、サーバーサイドで実行時やユーザーが `` を通して遷移したときに Nuxt.js によって何が呼ばれるかを表しています。

-## Server Rendered
+
+
+## サーバーサイドレンダリング
-You can use nuxt.js as a framework to handle all the UI rendering of your project.
+
-When launching `nuxt`, it will start a development server with hot-reloading and vue-server-renderer configured to automatically server-render your application.
+Nuxt.js をプロジェクトの UI レンダリング全体を担うフレームワークとして使うことができます。
-Take a look at [the commands](/guide/commands) to learn more about it.
+
-If you already have a server, you can plug nuxt.js by using it as a middleware, there is no restriction at all when using nuxt.js for developing your Universal Web Applications, see the [Using Nuxt.js Programmatically](/api/nuxt) guide.
+`nuxt` コマンドを実行すると、ホットリローディング及び自動的にアプリケーションをサーバーサイドレンダリングするよう設定された vue-server-render を備えた開発サーバーが起動されます。
-## Static Generated
+
-The big innovation of nuxt.js comes here: `nuxt generate`
+コマンドについてより深く学ぶには [コマンド](/guide/commands) を参照してください。
-When building your application it will generate the HTML of every of your routes to store it in a file.
+
-Example:
+既にサーバーがあるなら Nuxt.js をミドルウェアとして追加ことができます。ユニバーサルなウェブアプリケーションを開発するために Nuxt.js を利用するにあたって何も制限はありません。[Using Nuxt.js Programmatically](/api/nuxt) ガイドを見てみてください。
+
+
+
+## 静的な生成
+
+
+
+`nuxt generate` という Nuxt.js の大きなイノベーションがやってきます。
+
+
+
+`nuxt generate` はアプリケーションをビルドする際に、すべてのルーティングの状態をファイル中に保存した HTML を生成します。
+
+
+
+例:
```bash
-| pages/
@@ -77,7 +140,10 @@ Example:
----| index.vue
```
-Will generate:
+
+
+下記を生成します:
+
```
-| dist/
----| about/
@@ -85,18 +151,38 @@ Will generate:
----| index.html
```
-This way, you can host your generated web application on any static hosting!
+
+
+このやり方により、どんな静的なホスティングサービスでも、生成されたウェブアプリケーションをホストすることができるようになります。
+
+
+
+最も良い例はこのウェブサイト自体です。このサイトは生成され GitHub Pages でホストされています:
+
+
+
+
+- [ソースコード](https://github.com/nuxt/nuxtjs.org) -->
+- [生成されたコード](https://github.com/nuxt/nuxtjs.org/tree/gh-pages) -->
+
+
+
+私たちは [docs リポジトリ](https://github.com/nuxt/docs) を更新するたびに毎回手動でアプリケーションを生成したくなかったので、AWS Lambda funtion から生成機能を実行しています:
+
+
+
+
+
+
+1. [nuxtjs.org リポジトリ](https://github.com/nuxt/nuxtjs.org) をクローンする
+2. `npm install` で依存しているライブラリをインストールする
+3. `nuxt generate` を実行する
+4. `dist` フォルダーを `gh-pages` ブランチにプッシュする
-The best example is this website. It is generated and hosted on Github Pages:
-- [Source code](https://github.com/nuxt/nuxtjs.org)
-- [Generated code](https://github.com/nuxt/nuxtjs.org/tree/gh-pages)
+
-We don't want to manually generate the application every time we update the [docs repository](https://github.com/nuxt/docs), so each push made calls an AWS Lambda function which:
-1. Clone the [nuxtjs.org repository](https://github.com/nuxt/nuxtjs.org)
-2. Install the dependencies via `npm install`
-3. Run `nuxt generate`
-4. Push the `dist` folder to the `gh-pages` branch
+こうして私たちは **サーバーレスで静的に生成されたウェブアプリケーション** を手に入れたのでした。:)
-We now have a **Serverless Static Generated Web Application** :)
+
-We can go further by thinking of an e-commerce web application made with `nuxt generate` and hosted on a CDN, and every time a product is out of stock or back in stock, we regenerate the web app. But if the user navigates through the web app in the meantime, it will be up to date thanks to the API calls made to the e-commerce API. No need to have multiple instances of a server + a cache anymore!
+さらに進めて `nuxt generate` で生成された E コマースのウェブアプリケーションを考えてみましょう。そのアプリケーションは CDN でホストされ、商品が在庫切れになったり入荷されたりするたびにアプリケーションが再生成されます。ユーザーがアプリケーション遷移している間に、在庫の状態が(再生成のおかげで)最新の状態になるのです。つまり、サーバーで複数のインスタンス及びキャッシュを持つ必要がなくなるのです!
From bf49efe47fdc287d7023ce1d249ca30c6dc79f19 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 20 Feb 2017 00:02:58 +0900
Subject: [PATCH 004/129] Translate ja/guide/contribution-guide.md
---
ja/guide/contribution-guide.md | 38 +++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/ja/guide/contribution-guide.md b/ja/guide/contribution-guide.md
index 556b9f490..976473294 100644
--- a/ja/guide/contribution-guide.md
+++ b/ja/guide/contribution-guide.md
@@ -1,19 +1,37 @@
---
-title: Contribution Guide
-description: Any contribution to Nuxt.js is more than welcome!
+title: 貢献ガイド
+description: "Nuxt.js へのどんな貢献も大歓迎します!"
---
-> Any contribution to Nuxt.js is more than welcome!
+
+
-## Reporting Issues
+
-A great way to contribute to the project is to send a detailed report when you encounter an issue. We always appreciate a well-written bug report, and will thank you for it! Before reporting an issue, please read carefully the documentation and search if any issue for your problem doesn't already exist: https://github.com/nuxt/nuxt.js/issues
+Nuxt.js へのどんな貢献も大歓迎します!
-## Pull Requests
+
-We'd love to see your pull requests, even if it's just to fix a typo. Any significant improvement should be documented as [a GitHub issue](https://github.com/nuxt/nuxt.js/issues) before anybody starts working on it.
+## 問題の報告
-### Convention
+
-- For a fix, the branch name should be `fix-XXX` where XXX is the issue number or the name of what your fix does
-- For a feature, the branch name should be `feature-XXX` where XXX is the issue number associated to this feature request
+このプロジェクトに貢献する方法のひとつは、問題に遭遇したときに詳細なレポートを送ることです。私たちは上手くまとめられたバグレポートとそれを送ってくださった方にいつも感謝しています!問題を報告する前に、ドキュメントを注意深く読み、また、遭遇した問題が既に https://github.com/nuxt/nuxt.js/issues に報告されていないかどうか検索してください。
+
+
+
+## プルリクエスト
+
+
+
+たとえそれが単にタイポの修正であっても、ぜひプルリクエストを送ってください。どんな重要な改善であっても、誰かが手を動かし始める前に [GitHub issue](https://github.com/nuxt/nuxt.js/issues) に記載してください。
+
+
+
+### 慣例
+
+
+
+
+- 不具合の修正であればブランチ名は `fix-XXX` にして、XXX には issue 番号または修正するものの名前を入れてください
+- 機能のプルリクエストであればブランチ名は `feature-XXX` にして、XXX にはその機能に関連する issue 番号を入れてください
From 1e8e5a41bd7cfe54353a4470a16998e043244dd4 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 20 Feb 2017 00:38:24 +0900
Subject: [PATCH 005/129] Translage ja/guide/installation.md
---
ja/guide/installation.md | 114 ++++++++++++++++++++++++++++++---------
1 file changed, 88 insertions(+), 26 deletions(-)
diff --git a/ja/guide/installation.md b/ja/guide/installation.md
index f20967e37..3eb79558f 100644
--- a/ja/guide/installation.md
+++ b/ja/guide/installation.md
@@ -1,53 +1,87 @@
---
-title: Installation
+title: インストール
description: Nuxt.js is really easy to get started with. A simple project only need the `nuxt` dependency.
---
-> Nuxt.js is really easy to get started with. A simple project only need the `nuxt` dependency.
+
+
-## Using Nuxt.js starter template
+
-To start quickly, the Nuxt.js team has created a [starter template](https://github.com/nuxt/starter).
+Nuxt.js はとても簡単に始められます。シンプルなプロジェクトでは必要なものは `nuxt` だけです。
-[Download the .zip](https://github.com/nuxt/starter/archive/source.zip) starter template or install it with vue-cli:
+
+
+## Nuxt.js を使ったスターターテンプレート
+
+
+
+素早くスタートできるようにするため、Nuxt.js チームは [スターターテンプレート](https://github.com/nuxt/starter) を作りました。
+
+
+
+[ZIP をダウンロード](https://github.com/nuxt/starter/archive/source.zip) するか、vue-cli を使ってインストールしてください:
```bash
$ vue init nuxt/starter
```
-> If [vue-cli](https://github.com/vuejs/vue-cli) is not installed, please install it with `npm install -g vue-cli`
+
-then install the dependencies:
+> もし [vue-cli](https://github.com/vuejs/vue-cli) をインストールしていなければ、`npm install -g vue-cli` でインストールしてください。
+
+
+
+それから依存するライブラリをインストールしてください:
```bash
$ cd
$ npm install
```
-and launch the project with:
+
+
+そしてプロジェクトを起動してください:
+
```bash
$ npm run dev
```
-The application is now running on http://localhost:3000
-
Nuxt.js will listen on the files changes inside the `pages` directory, so no need to restart the application when adding new pages
+
-To discover more about the directory structure of the project: [Directory Structure Documentation](/guide/directory-structure).
+するとアプリケーションは http://localhost:3000 で動きます。
-## Starting from scratch
+
-Creating a Nuxt.js application from scratch is also really easy, it only needs *1 file and 1 directory*. Let's create an empty directory to start working on the application:
+
+
+
-To discover more about the directory structure of the project: [Directory Structure Documentation](/guide/directory-structure).
+プロジェクトのディレクトリ構造についてより深く理解するには [ディレクトリ構造のドキュメント](/guide/directory-structure) を参照してください。
From 11986064d758d4108c092d90a6283f3c77e55966 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 20 Feb 2017 20:45:41 +0900
Subject: [PATCH 006/129] Translate ja/guide/directory-structure.md
---
ja/guide/directory-structure.md | 177 ++++++++++++++++++++++++--------
1 file changed, 134 insertions(+), 43 deletions(-)
diff --git a/ja/guide/directory-structure.md b/ja/guide/directory-structure.md
index e3996480e..f648e0365 100644
--- a/ja/guide/directory-structure.md
+++ b/ja/guide/directory-structure.md
@@ -1,83 +1,167 @@
---
-title: Directory Structure
-description: The default Nuxt.js application structure is intended to provide a great starting point for both large and small applications.
+title: ディレクトリ構造
+description: デフォルトの Nuxt.js アプリケーションの構造は、小規模のアプリケーションと大規模のアプリケーションのどちらにも適しています。
---
-> The default Nuxt.js application structure is intended to provide a great starting point for both small and large applications. Of course, you are free to organize your application however you like.
+
+
-## Directories
+
-### The Assets Directory
+> デフォルトの Nuxt.js アプリケーションの構造は、小規模のアプリケーションと大規模のアプリケーションのどちらにも適しています。もちろん、好きなように構成することもできます。
-The `assets` directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
+
-[More documentation about Assets integration](/guide/assets)
+## ディレクトリ
-### The Components Directory
+
-The `components` directory contains your Vue.js Components. Nuxt.js doesn't supercharge the data method on these components.
+### アセットディレクトリ
-### The Layouts Directory
+
-The `layouts` directory contains your Application Layouts.
+`assets` ディレクトリには LESS や SASS、JavaScript のようなコンパイルされていないファイルを入れます。
-_This directory can not be renamed._
+
-[More documentation about Layouts integration](/guide/views#layouts)
+アセットファイルの統合についてより深く理解するには [こちらのドキュメント](/guide/assets) を参照してください。
-### The Middleware Directory
+
+
+### コンポーネントディレクトリ
+
+
+
+`components` ディレクトリには Vue.js のコンポーネントファイルを入れます。Nuxt.js はそれらのコンポーネントの data メソッドに過給しません(訳に自信なし。原文は Nuxt.js doesn't supercharge the data method on these components.)
+
+
+
+### レイアウトディレクトリ
+
+
+
+`layouts` ディレクトリにはアプリケーションのレイアウトファイルを入れます。
+
+
+
+_このディレクトリ名は変更できません。_
+
+
+
+レイアウトファイルの統合についてより深く理解するには [こちらのドキュメント](/guide/views#layouts) を参照してください。
+
+
+
+### ミドルウェアディレクトリ
_Coming soon_
-### The Pages Directory
+
+
+### ページディレクトリ
+
+
+
+`pages` ディレクトリにはアプリケーションのビュー及びルーティングファイルを入れます。Nuxt.js フレームワークはこのディレクトリ内の全ての `.vue` ファイルを読み込み、アプリケーションのルーターを作成します。
+
+
+
+_このディレクトリ名は変更できません。_
+
+
+
+ページファイルの統合についてより深く理解するには [こちらのドキュメント](/guide/views) を参照してください。
-The `pages` directory contains your Application Views and Routes. The framework reads all the `.vue` files inside this directory and create the router of your application.
+
-_This directory can not be renamed._
+### プラグインディレクトリ
-[More documentation about Pages integration](/guide/views)
+
-### The Plugins Directory
+`plugins` ディレクトリには、ルートの vue.js アプリケーションをインスタンス化する前に実行したい Javascript プラグインを入れます。
-The `plugins` directory contains your Javascript plugins that you want to run before instantiating the root vue.js application.
+
-[More documentation about Plugins integration](/guide/plugins)
+プラグインの統合についてより深く理解するには [こちらのドキュメント](/guide/plugins) を参照してください。
-### The Static Directory
+
-The `static` directory contains your static files. Each files inside this directory is mapped to /.
+### スタティックディレクトリ
-**Example:** /static/robots.txt is mapped as /robots.txt
+
-_This directory can not be renamed._
+`static` ディレクトリには静的なファイルを入れます。このディレクトリ内のファイルはいずれも `/` に配置されます。
-[More documentation about Static integration](/guide/assets#static)
+
-### The Store Directory
+**例:** /static/robots.txt は /robots.txt に配置されます。
-The `store` directory contains your [Vuex Store](http://vuex.vuejs.org) files. Vuex Store option is implemented in the Nuxt.js framework. Creating a `index.js` file in this directory activate the option in the framework automatically.
+
-_This directory can not be renamed._
+_このディレクトリ名は変更できません。_
-[More documentation about Store integration](/guide/vuex-store)
+
-### The nuxt.config.js File
+静的なファイルの統合についてより深く理解するには [こちらのドキュメント](/guide/assets#static) を参照してください。
-The `nuxt.config.js` file contains your Nuxt.js custom configuration.
+
-_This file can not be renamed._
+### ストアディレクトリ
-[More documentation about nuxt.config.js integration](/guide/configuration)
+
-### The package.json File
+`store` ディレクトリには [Vuex Store](http://vuex.vuejs.org) のファイルを入れます。Vuex Store は Nuxt.js フレームワークではオプションとして実装されています。このディレクトリ内に `index.js` ファイルを作成すると、Nuxt.js フレームワーク内でこのオプションが自動的に有効になります。
-The `package.json` file contains your Application dependencies and scripts.
+
-_This file can not be renamed._
+_このディレクトリ名は変更できません。_
-## Aliases
+
-| Alias | Directory |
+ストアファイルの統合についてより深く理解するには [こちらのドキュメント](/guide/vuex-store) を参照してください。
+
+
+
+### nuxt.config.js ファイル
+
+
+
+`nuxt.config.js` ファイルには Nuxt.js のカスタム設定を記述します。
+
+
+
+_このファイル名は変更できません。_
+
+
+
+nuxt.config.js についてより深く理解するには [こちらのドキュメント](/guide/configuration) を参照してください。
+
+
+
+### package.json ファイル
+
+
+
+`package.json` ファイルにはアプリケーションが依存するライブラリやスクリプトを記述します。
+
+
+
+_このファイル名は変更できません。_
+
+
+
+## エイリアス(別名)
+
+
+
+
+
+
+
+
+
+
+| エイリアス | ディレクトリ |
|-----|------|
| ~ | / |
| ~assets | /assets |
@@ -86,9 +170,16 @@ _This file can not be renamed._
| ~plugins | /plugins |
| ~static | /static |
-Aliases which link to files:
+
+
+ファイルへリンクするエイリアス:
+
+
+
+
+
-| Alias | Usage | Description |
+| エイリアス | 使い方 | 説明 |
|-------|------|--------------|
-| ~store | `const store = require('~store')` | Import the `vuex` store instance. |
-| ~router | `const router = require('~router')`| Import the `vue-router` instance. |
+| ~store | `const store = require('~store')` | `vuex` ストアのインスタンスをインポートします |
+| ~router | `const router = require('~router')`| `vue-router` のインスタンスをインポートします |
From 95aed6b29020ee333b2fddb084b1ffc7536c88e2 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 20 Feb 2017 21:13:44 +0900
Subject: [PATCH 007/129] Translate ja/guide/configuration.md
---
ja/guide/configuration.md | 115 ++++++++++++++++++++++++++++----------
1 file changed, 86 insertions(+), 29 deletions(-)
diff --git a/ja/guide/configuration.md b/ja/guide/configuration.md
index 4307a9a69..15250af2a 100644
--- a/ja/guide/configuration.md
+++ b/ja/guide/configuration.md
@@ -1,84 +1,141 @@
---
-title: Configuration
-description: The Nuxt.js default configuration covers most of usages. However, the nuxt.config.js file lets you overwrite it.
+title: 設定
+description: Nuxt.js ではデフォルトの設定でほとんどのユースケースをカバーしています。しかし nuxt.config.js で設定を上書きすることができます。
---
-> The Nuxt.js default configuration covers most of usages. However, the nuxt.config.js file lets you overwrite it.
+
+
+
+
+
+> Nuxt.js ではデフォルトの設定でほとんどのユースケースをカバーしています。しかし nuxt.config.js で設定を上書きすることができます。
### build
-This option lets you add modules inside the vendor.bundle.js file generated to reduce the size of the app bundle. It's really useful when using external modules
+
+
+このオプションで、アプリケーションのバンドルファイルのサイズを削減するために生成される vendor.bundle.js ファイル内にモジュールを追加できます。外部のモジュールを使うときに役に立ちます。
+
+
-[Documentation about build integration](/api/configuration-build)
+[build オプションに関するドキュメント](/api/configuration-build)
### cache
-This option lets you enable cached components for better render performances.
+
-[Documentation about cache integration](/api/configuration-cache)
+このオプションで、レンダリングのパフォーマンスを向上させるためにコンポーネントをキャッシュできます。
+
+
+
+[cache オプションに関するドキュメント](/api/configuration-cache)
### css
-This option lets you define the CSS files/modules/libraries you want to set as globals (included in every pages).
+
+
+このオプションで、グローバルに利用したい(どのファイルにもインクルードしたい)CSS ファイル/モジュール/ライブラリを指定できます。
-[Documentation about css integration](/api/configuration-css)
+
+
+[css オプションに関するドキュメント](/api/configuration-css)
### dev
-This option lets you define the development or production mode of nuxt.js
+
+
+このオプションで、Nuxt.js の開発モードまたはプロダクションモードを定義できます。
-[Documentation about dev integration](/api/configuration-dev)
+
+
+[dev オプションに関するドキュメント](/api/configuration-css)
### env
-This option lets you define environment variables available both client and server side.
+
+
+このオプションで、クライアントサイドでもサーバーサイドでも使える環境変数を指定できます。
-[Documentation about env integration](/api/configuration-env)
+
+
+[env オプションに関するドキュメント](/api/configuration-env)
### generate
-This option lets you to define each params value for every dynamic routes in your application that Nuxt.js transforms into HTML files.
+
+
+このオプションで、Nuxt.js が HTML ファイルに変換するアプリケーション内の動的なルーティングのためのパラメータを指定できます。(訳に自信なし。原文は This option lets you to define each params value for every dynamic routes in your application that Nuxt.js transforms into HTML files.)
+
+
-[Documentation about generate integration](/api/configuration-generate)
+[generate オプションに関するドキュメント](/api/configuration-generate)
### head
-This option lets you to define all the defaults metas for your application.
+
-[Documentation about head integration](/api/configuration-head)
+このオプションで、アプリケーションのデフォルトのメタ情報(訳注: head タグ内のメタタグの情報)を指定できます。
+
+
+
+[head オプションに関するドキュメント](/api/configuration-head)
### loading
-This option lets you to customize the loading component load by default with Nuxt.js.
+
+
+このオプションで、Nuxt.js のデフォルトのローディングコンポーネントをカスタマイズできます。
+
+
-[Documentation about loading integration](/api/configuration-loading)
+[loading オプションに関するドキュメント](/api/configuration-loading)
### plugins
-This option lets you to define Javascript plugins to be ran before instantiating the root vue.js application.
+
-[Documentation about plugins integration](/api/configuration-plugins)
+このオプションで、ルートの vue.js アプリケーションをインスタンス化する前に実行したい Javascript plugin を指定できます。
+
+
+
+[plugings オプションに関するドキュメント](/api/configuration-plugins)
### rootDir
-This option lets you define the workspace of your nuxt.js application.
+
+
+このオプションで、Nuxt.js アプリケーションのワークスペースを指定できます。
-[Documentation about rootDir integration](/api/configuration-rootdir)
+
+
+[rootDir オプションに関するドキュメント](/api/configuration-rootdir)
### router
-This option lets you to overwrite the default Nuxt.js configuration of vue-router.
+
+
+このオプションで、Nuxt.js のデフォルトの vue-router 設定を上書きできます。
-[Documentation about router integration](/api/configuration-router)
+
+
+[router オプションに関するドキュメント](/api/configuration-router)
### srcDir
-This option lets you define the source directory of your nuxt.js application.
+
+
+このオプションで、Nuxt.js のソースディレクトリを指定できます。
-[Documentation about srcDir integration](/api/configuration-srcdir)
+
+
+[srcDir オプションに関するドキュメント](/api/configuration-srcdir)
### transition
-This option lets you define the default properties of the pages transitions.
+
+
+このオプションで、ページ間の遷移のデフォルト設定を指定できます。
+
+
-[Documentation about transition integration](/api/configuration-transition)
+[transition オプションに関するドキュメント](/api/configuration-transition)
From 7f0af184e2daa8b534ba4596bb87ff345fe9d3eb Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Tue, 21 Feb 2017 04:35:45 +0900
Subject: [PATCH 008/129] Translate ja/guide/routing.md
---
ja/guide/routing.md | 216 +++++++++++++++++++++++++++++++++-----------
1 file changed, 165 insertions(+), 51 deletions(-)
diff --git a/ja/guide/routing.md b/ja/guide/routing.md
index cbfbe464c..0e31539a8 100644
--- a/ja/guide/routing.md
+++ b/ja/guide/routing.md
@@ -1,13 +1,22 @@
---
-title: Routing
-description: Nuxt.js use the file-system to generate the routes of your web applications, it's as simple as PHP to create routes.
+title: ルーティング
+description: Nuxt.js はウェブアプリケーションのルーティングを生成するためにファイルシステムを利用します。それは PHP がルーティングを生成するようにシンプルです。
---
-> Nuxt.js generates automatically the [vue-router](https://github.com/vuejs/vue-router) configuration according to your file tree of Vue files inside the `pages` directory.
+
+
-## Basic Routes
+
-This file tree:
+> Nuxt.js は `pages` ディレクトリ内の Vue ファイルの木構造に沿って、自動的に [vue-router](https://github.com/vuejs/vue-router) の設定を生成します。
+
+
+
+## ルーティングの基礎
+
+
+
+下記のようなファイルの木構造のとき:
```bash
pages/
@@ -17,7 +26,9 @@ pages/
--| index.vue
```
-will automatically generate:
+
+
+自動的に以下が生成されます:
```js
router: {
@@ -41,11 +52,17 @@ router: {
}
```
-## Dynamic Routes
+
+
+## 動的なルーティング
+
+
-To define a dynamic route with a param, you need to define a .vue file OR a directory **prefixed by an underscore**.
+パラメータを使って動的なルーティングを定義するには、.vue ファイル名またはディレクトリ名に **アンダースコアのプレフィックス** を付ける必要があります。
-This file tree:
+
+
+下記のような木構造のとき:
```bash
pages/
@@ -57,7 +74,9 @@ pages/
--| index.vue
```
-will automatically generate:
+
+
+自動的に以下が生成されます:
```js
router: {
@@ -86,36 +105,67 @@ router: {
}
```
-As you can see the route named `users-id` has the path `:id?` which makes it optional, if you want to make it required, create an `index.vue` file in the `users` directory.
+
+
+`user-id` と名付けられたルートに `:id?` というパスがありますが、これはこの `:id` が必須ではないことを表します。もし必須にしたい場合は `users` ディレクトリ内に `index.vue` ファイルを作成してください(訳注: `users/_id` ディレクトリ内に `index.vue` ファイルを作成するのでは?)
+
+
+
+### ルーティングのパラメータのバリデーション
+
+
+
+Nuxt.js では、動的なルーティングをするコンポーネント内に、パラメータをバリデーションするメソッドを定義することができます。
-### Validate Route Params
+
-Nuxt.js lets you define a validator method inside your dynamic route component.
+例えば `pages/users/_id.vue` 内にこのように書きます:
-In this example: `pages/users/_id.vue`
+
+
+
+
+
+
+
+
```js
export default {
validate ({ params }) {
- // Must be a number
+ // 数値でなければならない
return /^\d+$/.test(params.id)
}
}
```
-If the validate method does not return `true`, Nuxt.js will automatically load the 404 error page.
+
-More information about the validate method: [API Pages validate](/api/pages-validate)
+もしバリデーションのメソッドが `true` を返さなかった場合は、Nuxt.js は自動的に 404 エラーページをロードします。
-## Nested Routes
+
-Nuxt.js lets you create nested route by using the children routes of vue-router.
+バリデーションのメソッドについてより深く理解したい場合は [ページバリデーションの API](/api/pages-validate) を参照してください。
-To define a nested route, you need to create a Vue file with the **same name as the directory** which contain your children views.
+
-
Don't forget to write `` inside the parent component (.vue file).
+
+
+
+下記のようなファイルの木構造のとき:
```bash
pages/
@@ -125,7 +175,9 @@ pages/
--| users.vue
```
-will automatically generate:
+
+
+自動的に以下が生成されます:
```js
router: {
@@ -150,11 +202,17 @@ router: {
}
```
-## Dynamic Nested Routes
+
+
+## 動的でネストしたルーティング
+
+
+
+このシナリオはあまり追加すべきではないのですが、Nuxt.js では動的な親ルーティングの中に動的な子ルーティングを持つことが可能です(訳注: 前半部分がうまく訳せませんでした。原文は This scenario should not often append, but it is possible with Nuxt.js: having dynamic children inside dynamic parents.)
-This scenario should not often append, but it is possible with Nuxt.js: having dynamic children inside dynamic parents.
+
-This file tree:
+下記のようなファイルの木構造のとき:
```bash
pages/
@@ -168,7 +226,9 @@ pages/
--| index.vue
```
-will automatically generate:
+
+
+自動的に以下が生成されます:
```js
router: {
@@ -209,17 +269,30 @@ router: {
}
```
-## Transitions
+
+
+## トランジション
+
+
-Nuxt.js uses the [<transition>](http://vuejs.org/v2/guide/transitions.html#Transitioning-Single-Elements-Components) component to let you create amazing transitions/animations between your routes.
+Nuxt.js では [<transition>](http://vuejs.org/v2/guide/transitions.html#Transitioning-Single-Elements-Components) コンポーネントを使って、ページ間を遷移する際のトランジション/アニメーションを行うことができます。
-### Global Settings
+
-
Nuxt.js default transition name is `"page"`.
+### グローバルな設定
-To add a fade transition to every page of your application, we need a CSS file that is shared across all our routes, so we start by creating a file in the `assets` folder.
+
+
+
Nuxt.js のデフォルトのトランジション名は `"page"` です。
+
+
+
+アプリケーションの全てのページでフェードさせるトランジションを定義には、ルーティング全体に適用されている CSS ファイルが必要です。まずは `assets` ディレクトリ内にファイルを作成するところから始めます:
+
+
+
+`assets/main.css` 内にグローバルな CSS を書きます:
-Our global css in `assets/main.css`:
```css
.page-enter-active, .page-leave-active {
transition: opacity .5s;
@@ -229,7 +302,10 @@ Our global css in `assets/main.css`:
}
```
-We add its path in our `nuxt.config.js` file:
+
+
+`nuxt.config.js` ファイルに CSS ファイルのパスを指定します:
+
```js
module.exports = {
css: [
@@ -238,13 +314,22 @@ module.exports = {
}
```
-More information about the transition key: [API Configuration transition](/api/pages-transition)
+
-### Page Settings
+トランジションについてより深く理解したい場合は [トランジションを設定する API](/api/pages-transition) を参照してください。
-You can also define a custom transition for only one page with the `transition` property.
+
+
+### 特定のページに対する設定
+
+
+
+`transition` プロパティを使うことで、特定のページのみに対してカスタムトランジションを定義することもできます。
+
+
+
+`assets/main.css` 内に新しい CSS 定義を追加します:
-We add a new class in our global css in `assets/main.css`:
```css
.test-enter-active, .test-leave-active {
transition: opacity .5s;
@@ -254,22 +339,35 @@ We add a new class in our global css in `assets/main.css`:
}
```
-then, we use the transition property to define the class name to use for this page transition:
+
+
+それから、このページトランジションを利用するためのクラス名を transition プロパティで指定します:
+
```js
export default {
transition: 'test'
}
```
-More information about the transition property: [API Pages transition](/api/pages-transition)
+
-## Middleware
+トランジションプロパティについてより深く理解したい場合は [ページトランジション API](/api/pages-transition) を参照してください。
-> The middleware lets you define custom function to be ran before rendering a page or a group of pages.
+
-**Every middleware should be placed in the `middleware/` directory.** The filename will be the name of the middleware (`middleware/auth.js` will be the `auth` middleware).
+## ミドルウェア
-A middleware receive [the context](/api#the-context) as first argument:
+
+
+> ミドルウェアを使って、あるページまたはあるページのグループがレンダリングされる前に実行される関数を定義することができます。
+
+
+
+**ミドルウェアは `middleware/` ディレクトリに入れます。** ファイル名はミドルウェアの名前となります(`middleware/auth.js` は `auth` ミドルウェアになります)
+
+
+
+ミドルウェアは第一引数として [context](/api#the-context) を受け取ります:
```js
export default function (context) {
@@ -277,14 +375,23 @@ export default function (context) {
}
```
-The middleware will be executed in series in this order:
+
+
+
+
+
+ミドルウェアは下記の順に実行されます:
+
1. `nuxt.config.js`
-2. Matched layouts
-3. Matched pages
+2. マッチしたレイアウト
+3. マッチしたページ
-A middleware can be asynchronous, simply return a `Promise` or use the 2nd `callback` argument:
+
+
+ミドルウェアは、`Promise` を返すようにするか、もしくは第二引数の `callback` を使って、非同期に実行することができます:
`middleware/stats.js`
+
```js
import axios from 'axios'
@@ -295,9 +402,12 @@ export default function ({ route }) {
}
```
-Then, in your `nuxt.config.js`, layout or page, use the `middleware` key:
+
+
+そして `nuxt.config.js` やレイアウトもしくはページ内で `middleware` キーを使います:
`nuxt.config.js`
+
```js
module.exports = {
router: {
@@ -306,6 +416,10 @@ module.exports = {
}
```
-The `stats` middleware will be called for every route changes.
+
+
+`stats` ミドルウェアは全てのルート変更時に呼び出されるようになります。
+
+
-To see a real-life example using the middleware, please see [example-auth0](https://github.com/nuxt/example-auth0) on GitHub.
+ミドルウェアを使った実際の例を見たい場合は GitHub 上にある [example-auth0](https://github.com/nuxt/example-auth0) を見てみてください。
From 705d9fab12d92b01c99d50c8d02627744bbb8624 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Tue, 21 Feb 2017 21:40:16 +0900
Subject: [PATCH 009/129] Translate ja/guide/views.md
---
ja/guide/views.md | 260 ++++++++++++++++++++++++++++++++++++----------
1 file changed, 203 insertions(+), 57 deletions(-)
diff --git a/ja/guide/views.md b/ja/guide/views.md
index a65de291f..414577bc5 100644
--- a/ja/guide/views.md
+++ b/ja/guide/views.md
@@ -1,13 +1,51 @@
---
-title: Views
-description: The Views section describes all you need to configure data and views for a specific route in your Nuxt.js application. (Pages, layouts and HTML Head)
+title: ビュー
+description: ビューセクションでは Nuxt.js アプリケーションの特定のルートにデータとビューを設定するために必要なこと全てを説明します(ページ、レイアウト、HTML の head タグのメタ情報などを含みます)
---
-> The Views section describes all you need to configure data and views for a specific route in your Nuxt.js application. (Pages, layouts and HTML Head)
+
+
-## Pages
+
-Every Page component is a Vue component, but Nuxt.js adds special keys to make the development of your universal application the easiest way possible.
+> ビューセクションでは Nuxt.js アプリケーションの特定のルートにデータとビューを設定するために必要なこと全てを説明します(ページ、レイアウト、HTML の head タグのメタ情報などを含みます)
+
+
+
+## ページ
+
+
+
+全てのページコンポーネントは Vue コンポーネントですが、Nuxt.js はユニバーサルなアプリケーションを最も簡単なやり方で開発することを可能にために、特別なキーを追加します。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```html
@@ -17,16 +55,16 @@ Every Page component is a Vue component, but Nuxt.js adds special keys to make t
@@ -38,52 +76,104 @@ export default {
```
-
-| Attribute | Description |
+
+
+
+
+
+
+
+
+
+
+
+| 属性 | 説明 |
|-----------|-------------|
-| data | The most important key, it has the same purpose as [Vue data](https://vuejs.org/v2/api/#Options-Data) but it can be asynchronous and receives the context as argument, please read the [async data documentation](/guide/async-data) to learn how it works. |
-| fetch | Used to fill the store before rendering the page, it's like the data method except it doesn't set the component data. See the [API Pages fetch documentation](/api/pages-fetch). |
-| head | Set specific Meta Tags for the current page, see [API Pages head documentation](/api/pages-head). |
-| layout | Specify a layout defined in the `layouts` directory, see [API Pages layouts documentation](/api/pages-layout). |
-| transition | Set a specific transition for the page, see [API Pages transition](/api/pages-transition). |
-| scrollToTop | Boolean, by default: `false`. Specify if you want the page to scroll to the top before rendering the page, it's used for [nested routes](/guide/routing#nested-routes). |
-| validate | Validator function for a [dynamic route](/guide/routing#dynamic-routes). |
-| middleware | Set a middleware for this page, the middleware will be called before rendering the page, see [routes middleware](/guide/routing#middleware). |
+| data | 最も重要なキーであり [Vue data](https://vuejs.org/v2/api/#Options-Data) と同じ意義を持っています。しかし非同期に動作し、また引数として context を受け取ります。どのように動作するかを知るには [非同期データに関するドキュメント](/guide/async-data) を参照してください。 |
+| fetch | ページがレンダリングされる前に、データをストアに入れるために使います。コンポーネントのデータをセットすること以外は data メソッドと似ています。[ページのフェッチ API に関するドキュメント](/api/pages-fetch) を参照してください。 |
+| head | 現在のページの特定のメタタグを設定します。[ページの head API に関するドキュメント](/api/pages-head) を参照してください。 |
+| layout | `layouts` ディレクトリ内のレイアウトを指定します。[ページのレイアウト API に関するドキュメント](/api/pages-layout) を参照してください。 |
+| transition | ページに特定のトランジションを設定します。[ページのトランジション API に関するドキュメント](/api/pages-transition) を参照してください。 |
+| scrollToTop | ブーリアンで指定し、デフォルトは `false` です。ページをレンダリングする前にトップまでスクロールさせるか否かを指定します。これは [ネストしたルーティング](/guide/routing#nested-routes) で使われます。 |
+| validate | [動的なルーティング](/guide/routing#dynamic-routes) のためのバリデーション関数です。 |
+| middleware | このページのためにミドルウェアを設定し、ミドルウェアはページがレンダリングされる前に呼び出されます。[ルーティングのミドルウェア](/guide/routing#middleware) を参照してください。 |
+
+
+
+ページのプロパティの使い方についてより深く理解したいときは [ページ API](/api) を参照してください。
+
+
+
+## レイアウト
-More information about the pages properties usage: [API Pages](/api)
+
-## Layouts
+Nuxt.js ではメインレイアウトを拡張したり、カスタムレイアウトを `layouts` ディレクトリに入れてレイアウトを追加したりすることができます。
-Nuxt.js lets you extend the main layout or create custom layouts by adding them in the `layouts` directory.
+
-### Default Layout
+### デフォルトレイアウト
-You can extend the main layout by adding a `layouts/default.vue` file.
+
-*Make sure to add the `` component when creating a layout to display the page component.*
+`layouts/default.vue` ファイルを追加することでメインレイアウトを拡張できます。
+
+
+
+*ページコンポーネントを表示するレイアウトを作成するときは、必ず `` コンポーネントを入れておくことを覚えておいてください。*
+
+
+
+デフォルトのレイアウトのソースコードは下記のようになっています:
-The default layout source code is:
```html
```
-### Error Page
+
+
+### エラーページ
+
+
+
+`layouts/error.vue` ファイルを追加することでエラーページをカスタマイズできます。
+
+
+
+このレイアウトはテンプレート内に `` を含まないという意味で特殊です。このレイアウトは 404 や 500 エラーなどが発生したときに表示されるコンポーネントとして見ることになります。
+
+
+
+デフォルトのエラーページのソースコードは [Github](https://github.com/nuxt/nuxt.js/blob/master/lib/app/components/nuxt-error.vue) で確認できます。
+
+
-You can customize the error page by adding a `layouts/error.vue` file.
+`layouts/error.vue` にカスタムエラーページを書くときの例:
-This layout is special since you should not include `` inside its template. You must see this layout as a component displayed when an error occurs (404, 500, etc).
+
+
+
+
+
+
+
+
-The default error page source code is [available on Github](https://github.com/nuxt/nuxt.js/blob/master/lib/app/components/nuxt-error.vue).
+
+
+
+
+
+
-Example of a custom error page in `layouts/error.vue`:
```html
-
Page not found
-
An error occurred
- Home page
+
ページが見つかりません
+
エラーが発生しました
+ ホーム
@@ -94,23 +184,44 @@ export default {
```
-### Custom Layout
+
-Every file (*first level*) in the `layouts` directory will create a custom layout accessible with the `layout` property in the page component.
+### カスタムレイアウト
-*Make sure to add the `` component when creating a layout to display the page component.*
+
+
+`layouts` ディレクトリの *第一階層* のファイルで、ページコンポーネント内の `layout` プロパティで指定できるカスタムレイアウトを作成できます。
+
+
+
+*ページコンポーネントを表示するレイアウトを作成するときは、必ず `` コンポーネントを入れておくことを覚えておいてください。*
+
+
+
+`layouts/blog.vue` の例:
+
+
+
+
+
+
+
+
+
-Example of `layouts/blog.vue`:
```html
-
My blog navigation bar here
+
ブログのナビゲーションバーをここに設置します
```
-And then in `pages/posts.vue`, you can tell Nuxt.js to use your custom layout:
+
+
+それから `pages/posts.vue` ファイル内で、カスタムレイアウトを使うことを Nuxt.js に伝えます:
+
```html
```
-More information about the layout property: [API Pages layout](/api/pages-layout)
+
+
+layout プロパティについてより深く理解するには [ページレイアウト API](/api/pages-layout) を参照してください。
+
+また、動作する様子を [デモ動画](https://www.youtube.com/watch?v=YOKnSTp7d38) で確認してみてください。
+
+
+
+## HTML の head 情報
-Check the [demonstration video](https://www.youtube.com/watch?v=YOKnSTp7d38) to see it in action.
+
-## HTML Head
+Nuxt.js はアプリケーションの `headers` 及び `html attributes` を更新するために [vue-meta](https://github.com/declandewet/vue-meta) を使います。
-Nuxt.js uses [vue-meta](https://github.com/declandewet/vue-meta) to update the `headers` and `html attributes` of your application.
+
+
+Nuxt.js では下記のオプションで `vue-meta` を設定します:
+
+
+
+
+
+
+
+
+
-Nuxt.js configures `vue-meta` with these options:
```js
{
- keyName: 'head', // the component option name that vue-meta looks for meta info on.
- attribute: 'n-head', // the attribute name vue-meta adds to the tags it observes
- ssrAttribute: 'n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
- tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
+ keyName: 'head', // vue-meta がメタ情報を探すためのコンポーネントオプションの名前
+ attribute: 'n-head', // vue-meta がタグを監視するためにタグに追加する属性名
+ ssrAttribute: 'n-head-ssr', // メタ情報が既にサーバーサイドでレンダリングされていることを vue-meta に知らせるための属性名
+ tagIDKeyName: 'hid' // vue-meta がタグを上書きすべきかタグを追加すべきか判断するために用いるプロパティ名
}
```
-### Default Meta Tags
+
+
+### デフォルトのメタタグ
+
+
+
+Nuxt.js ではアプリケーションのデフォルトのメタ情報を `nuxt.config.js` で設定できます。`head` プロパティを使用します:
+
+
-Nuxt.js let you define all default meta for your application inside `nuxt.config.js`, use the same `head` property:
+カスタム viewport 及び Google フォントを定義する例:
-Example of a custom viewport with a custom Google font:
```js
head: {
meta: [
@@ -154,12 +290,22 @@ head: {
}
```
-To know the list of options you can give to `head`, take a look at [vue-meta documentation](https://github.com/declandewet/vue-meta#recognized-metainfo-properties).
+
+
+`head` に渡せるオプションのリストを確認するには [vue-meta のドキュメント](https://github.com/declandewet/vue-meta#recognized-metainfo-properties) を見てみてください。
+
+
+
+head メソッドについてより深く理解するためには [head 設定 API](/api/configuration-head) を参照してください。
+
+
+
+### 特定のページにメタタグを設定する
-More information about the head method: [API Configuration head](/api/configuration-head)
+
-### Custom Meta Tags for a Page
+特定のページにメタタグを設定する方法について [ページ head API](/api/pages-head) を参照してください。
-More information about the head method: [API Pages head](/api/pages-head)
+
-
To avoid any duplication when used in child component, please give a unique identifier with the `hid` key, please [read more about it](https://github.com/declandewet/vue-meta#lists-of-tags).
From 88eaf81127659fd631eac0e96273b6a8686cc4be Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 22 Feb 2017 00:01:25 +0900
Subject: [PATCH 010/129] Translate ja/guide/async-data.md
---
ja/guide/async-data.md | 130 +++++++++++++++++++++++++++++++++--------
1 file changed, 105 insertions(+), 25 deletions(-)
diff --git a/ja/guide/async-data.md b/ja/guide/async-data.md
index de3f3fb2e..b99db8c1f 100644
--- a/ja/guide/async-data.md
+++ b/ja/guide/async-data.md
@@ -1,23 +1,45 @@
---
-title: Async Data
-description: Nuxt.js supercharges the data method from vue.js to let you handle async operation before setting the component data.
+title: 非同期なデータ
+description: Nuxt.js は、コンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の data メソッドを過給します
---
-> Nuxt.js *supercharges* the `data` method from vue.js to let you handle async operation before setting the component data.
+
+
-## The data Method
+
-`data` is called every time before loading the component (**only for pages components**). It can be called from the server-side or before navigating to the corresponding route. This method receives [the context](/api#context) as the first argument, you can use it to fetch some data and return the component data.
+> Nuxt.js は、コンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の `data` メソッドを *過給* します(訳注: supercharges をうまく訳せませんでした。原文は Nuxt.js *supercharges* the `data` method from vue.js to let you handle async operation before setting the component data.)
-
You do **NOT** have access of the component instance trough `this` inside `data` because it is called **before initiating** the component.
`data` メソッド内の `this` を通してコンポーネントのインスタンスにアクセスすることは **できません**。それはコンポーネントがインスタンス化される前に data メソッドが呼び出されるためです。
+
+
To make the data method asynchronous, nuxt.js offers you different ways, choose the one you're the most familiar with:
-1. returning a `Promise`, nuxt.js will wait for the promise to be resolved before rendering the component.
-2. Using the [async/await proposal](https://github.com/lukehoban/ecmascript-asyncawait) ([learn more about it](https://zeit.co/blog/async-and-await))
-3. Define a callback as second argument. It has to be called like this: `callback(err, data)`
+Nuxt.js では data メソッドを非同期にするために、いくつかの異なるやり方があるので、最もなじむものを選択してください:
+
+
+
+
+
+1. `Promise` を返す。Nuxt.js はコンポーネントがレンダリングされる前に Promise が解決されるまで待ちます。
+2. [async/await](https://github.com/lukehoban/ecmascript-asyncawait) を使う。([より深く理解する](https://zeit.co/blog/async-and-await))
+3. 第二引数としてコールバックを定義する。右のように呼び出される必要があります: `callback(err, data)`
+
+
+
+### Promise を返す
-### Returning a Promise
```js
export default {
data ({ params }) {
@@ -29,7 +51,10 @@ export default {
}
```
-### Using async/await
+
+
+### async/await を使う
+
```js
export default {
async data ({ params }) {
@@ -39,7 +64,10 @@ export default {
}
```
-### Using a callback
+
+
+### コールバックを使う
+
```js
export default {
data ({ params }, callback) {
@@ -51,9 +79,13 @@ export default {
}
```
-### Returning an Object
+
+
+### オブジェクトを返す
-If you don't need to do any asynchronous call, you can simply return an object:
+
+
+もし非同期に実行する必要がなければ、シンプルにオブジェクトを返せば良いです:
```js
export default {
@@ -63,9 +95,13 @@ export default {
}
```
-### Displaying the data
+
+
+### データを表示する
-When the data method set, you can display the data inside your template like you used to do:
+
+
+data メソッドがセットされると、下記のように template の内側でデータを表示することができます:
```html
@@ -73,15 +109,40 @@ When the data method set, you can display the data inside your template like you
```
-## The Context
+
+
+## コンテキスト
+
+
+
+`context` 内で利用できるキーの一覧を確認するには [ページ data API](/api) をご覧ください。
+
+
-To see the list of available keys in `context`, take a look at the [API Pages data](/api).
+## エラー処理
-## Handling Errors
+
-Nuxt.js add the `error(params)` method in the `context`, you can call it to display the error page. `params.statusCode` will be also used to render the proper status code form the server-side.
+Nuxt.js は `context` の中に `error(params)` メソッドを追加しました。これを呼び出すことでエラーページを表示できます。
+
+
+
+`Promise` を使った例:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-Example with a `Promise`:
```js
export default {
data ({ params, error }) {
@@ -90,13 +151,30 @@ export default {
return { title: res.data.title }
})
.catch((e) => {
- error({ statusCode: 404, message: 'Post not found' })
+ error({ statusCode: 404, message: 'ページが見つかりません' })
})
}
}
```
-If you're using the `callback` argument, you can call it directly with the error, nuxt.js will call the `error` method for you:
+
+
+`callback` 引数を使っているときは、直接、エラー内容と共に callback を呼び出すことができ、そうすると Nuxt.js は `error` メソッドを実行します。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```js
export default {
data ({ params }, callback) {
@@ -105,10 +183,12 @@ export default {
callback(null, { title: res.data.title })
})
.catch((e) => {
- callback({ statusCode: 404, message: 'Post not found' })
+ callback({ statusCode: 404, message: 'ページが見つかりません' })
})
}
}
```
-To customize the error page, take a look at the [VIEWS layouts section](/guide/views#layouts).
+
+
+エラーページをカスタマイズするためには [ビューページのレイアウトセクション](/guide/views#layouts) を参照してください。
From f5898517ce81a0f05bde83d47a0f74ede4cc7bbf Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 22 Feb 2017 23:54:50 +0900
Subject: [PATCH 011/129] Translate ja/guide/assets.md
---
ja/guide/assets.md | 105 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 80 insertions(+), 25 deletions(-)
diff --git a/ja/guide/assets.md b/ja/guide/assets.md
index 7b6faba44..442ad5935 100644
--- a/ja/guide/assets.md
+++ b/ja/guide/assets.md
@@ -1,15 +1,26 @@
---
-title: Assets
-description: Nuxt uses vue-loader, file-loader and url-loader for Webpack by default for strong assets serving, but you can also use Static directory for static assets.
+title: アセット
+description: Nuxt.js はアセットファイルを配信するために Webpack のローダーとしてデフォルトで vue-loader、file-loader 及び url-loader を使いますが、静的ファイルのためのディレクトリを使うこともできます。
---
-> Nuxt uses vue-loader, file-loader and url-loader for Webpack by default for strong assets serving, but you can also use Static directory for static assets.
+
+
-## Webpacked
+
-By default, [vue-loader](http://vue-loader.vuejs.org/en/) automatically processes your style and template files with `css-loader` and the Vue template compiler. In this compilation process, all asset URLs such as ``, `background: url(...)` and CSS `@import` are resolved as module dependencies.
+> Nuxt.js はアセットファイルを配信するために Webpack のローダーとしてデフォルトで vue-loader、file-loader 及び url-loader を使いますが、静的ファイルのためのディレクトリを使うこともできます。
-For example, we have this file tree:
+
+
+## Webpack
+
+
+
+デフォルトでは [vue-loader](http://vue-loader.vuejs.org/en/) がスタイルやテンプレートファイルを `css-loader` や Vue テンプレートコンパイラを用いて自動的に処理します。このコンパイル処理の中で、`` や `background: url(...)` や CSS `@import` などの全ての URL はモジュールの依存関係のように解決されます。
+
+
+
+例えば、このようなファイルがあるとします:
```bash
-| assets/
@@ -18,28 +29,45 @@ For example, we have this file tree:
----| index.vue
```
-In my CSS, if I use `url('~assets/image.png')`, it will be translated into `require('~assets/image.png')`.
+
+
+CSS で `url('~assets/image.png')` と書いていたら、それは `require('~assets/image.png')` に変換されます。
+
+
+
+あるいは `pages/index.vue` の中で下記のように書いていたとします:
-Or if in my `pages/index.vue`, I use:
```html
```
-It will be compiled into:
+
+
+それは次のようにコンパイルされます:
```js
createElement('img', { attrs: { src: require('~assets/image.png') }})
```
-Because `.png` is not a JavaScript file, nuxt.js configures Webpack to use [file-loader](https://github.com/webpack/file-loader) and [url-loader](https://github.com/webpack/url-loader) to handle them for you.
+
+
+`.png` は JavaScript ファイルではないため、Nuxt.js は Webpack が PNG ファイルを扱えるように [file-loader](https://github.com/webpack/file-loader) と [url-loader](https://github.com/webpack/url-loader) を使う設定を行います。
+
+
+
+file-loader と url-loader を使うメリット:
+
+
+
-The benefits of them are:
-- `file-loader` lets you designate where to copy and place the asset file, and how to name it using version hashes for better caching.
-- `url-loader` allows you to conditionally inline a file as base-64 data URL if they are smaller than a given threshold. This can reduce a number of HTTP requests for trivial files. If the file is larger than the threshold, it automatically falls back to `file-loader`.
+- `file-loader` はアセットファイルをどこにコピーし配置すべきか、また、より良いキャッシングのためにバージョンのハッシュ値を使って、なんというファイル名にすべきかを指定します。
+- `url-loader` はもしファイルサイズが閾値よりも小さければ、ファイルを BASE64 データとして埋め込みます。これにより小さなファイルを取得するための HTTP リクエストの数を減らすことができます。もしファイルサイズが閾値よりも大きければ、自動的に `file-loader` にフォールバックします。
-Actually, Nuxt.js default loaders configuration is:
+
+
+実際には Nuxt.js のデフォルトのローダー設定は次のようになっています:
```js
[
@@ -62,9 +90,13 @@ Actually, Nuxt.js default loaders configuration is:
]
```
-Which means that every file below 1 KO will be inlined as base-64 data URL. Otherwise, the image/font will be copied in its corresponding folder (under the `.nuxt` directory) with a name containing a version hashes for better caching.
+
+
+ファイルサイズが 1KO を下回るファイルはすべて base-64 データとして埋め込まれます。反対に 1KO を上回る画像やフォントは(`.nuxt` ディレクトリ配下の)対応するディレクトリにより良いキャッシングのためのバージョンのハッシュ値を含んだファイル名でコピーされます。
-When launching our application with `nuxt`, our template in `pages/index.vue`:
+
+
+アプリケーションを `nuxt` コマンドで起動するとき、`pages/index.vue` 内のテンプレートは下記のようになっていて:
```html
@@ -72,27 +104,50 @@ When launching our application with `nuxt`, our template in `pages/index.vue`:
```
-Will be generated into:
+
+
+そこから次のように生成されます:
+
```html
```
-If you want to update these loaders or disable them, please take a look at the [loaders configuration](/api/configuration-build#loaders).
+
+
+これらのローダーの設定を更新したり、ローダーを使わないようにしたいするには、[ローダー設定](/api/configuration-build#loaders) を参照してください。
+
+
+
+## 静的なファイル
+
+
+
+もし Webpack で扱う対象となる `assets` ディレクトリを使いたくない場合は、プロジェクトのルートディレクトリに `static` ディレクトリを作成して利用することができます。
+
+
+
+これらのファイルは自動的に Nuxt.js により配信され、またプロジェクトのルート URL からアクセス可能になります。
+
+
-## Static
+このオプションは `robots.txt` や `sitemap.xml` などのファイルに役に立ちます。
-If you don't want to use Webpacked Assets from the `assets` directory, you can create and use the `static` directory in your project root directory.
+
-These files will be automatically serve by Nuxt and accessible in your project root URL.
+`/` URL からそれらのファイルを参照できます:
-This option is helpful for files like `robots.txt` or `sitemap.xml`.
+
+
+
-From your code you can then reference those files with `/` URLs:
+
+
+
```html
-
+
-
+
```
From d73d9940a7fd0f2dd7dcd45c660475f1c76f5c98 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 00:15:07 +0900
Subject: [PATCH 012/129] Translate ja/guide/plugins.md
---
ja/guide/plugins.md | 83 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 63 insertions(+), 20 deletions(-)
diff --git a/ja/guide/plugins.md b/ja/guide/plugins.md
index 03a8f04b0..710985fcd 100644
--- a/ja/guide/plugins.md
+++ b/ja/guide/plugins.md
@@ -1,23 +1,38 @@
---
-title: Plugins
-description: Nuxt.js allows you to define js plugins to be ran before instantiating the root vue.js application, it can be to use your own library or external modules.
+title: プラグイン
+description: Nuxt.js ではルートの Vue.js アプリケーションがインスタンス化される前に実行される js プラグインを定義することができます。プラグインとして自前のライブラリや外部モジュールを使うことができます。
---
-> Nuxt.js allows you to define js plugins to be ran before instantiating the root vue.js application, it can be to use your own library or external modules.
+
+
-
It is important to know that in any Vue [instance lifecycle](https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram), only `beforeCreate` and `created` hooks are called **both from client-side and server-side**. All other hooks are called only from the client-side.
+
-## External Packages
+> Nuxt.js ではルートの Vue.js アプリケーションがインスタンス化される前に実行される js プラグインを定義することができます。プラグインとして自前のライブラリや外部モジュールを使うことができます。
-We may want to use external packages/modules in our application, one great example is [axios](https://github.com/mzabriskie/axios) for making HTTP request for both server and client.
+
-We install it via NPM:
+
+
+
+
+## 外部パッケージ
+
+
+
+アプリケーションに外部パッケージ/モジュールを使いたいときがあるかもしれません。例えばサーバーでもクライアントでも HTTP リクエストを送れるようにするための [axios](https://github.com/mzabriskie/axios) が良い例です。
+
+
+
+NPM 経由でインストールします:
```bash
npm install --save axios
```
-Then, we can use it directly in our pages:
+
+
+そしてページ内で直接それを使うことができます:
```html
@@ -36,7 +51,9 @@ export default {
```
-But there is **one problem here**, if we import axios in another page, it will be included again for the page bundle. We want to include `axios` only once in our application, for this, we use the `build.vendor` key in our `nuxt.config.js`:
+
+
+しかし、**ひとつ問題があって**、仮に別のページで axios をインポートすると、そのページでもまたインクルードされてしまいます。この問題に対して、`axios` をアプリケーション内で一度だけインクルードしたいと思い、`nuxt.config.js` 内で `build.vendor` キーを使うようにしました。
```js
module.exports = {
@@ -46,13 +63,22 @@ module.exports = {
}
```
-Then, I can import `axios` anywhere without having to worry about making the bundle bigger!
+
+
+こうするとバンドルファイルが膨れ上がる心配なしに `axios` をどこでもインポートできます。
+
+
+
+## Vue プラグイン
+
+
-## Vue Plugins
+アプリケーション内で通知を表示するために [vue-notifications](https://github.com/se-panfilov/vue-notifications) を使いたいときには、アプリケーションを起動する前にプラグインをセットアップする必要があります。
-If we want to use [vue-notifications](https://github.com/se-panfilov/vue-notifications) to display notification in our application, we need to setup the plugin before launching the app.
+
+
+`plugins/vue-notifications.js` ファイルを次のようにします:
-File `plugins/vue-notifications.js`:
```js
import Vue from 'vue'
import VueNotifications from 'vue-notifications'
@@ -60,18 +86,28 @@ import VueNotifications from 'vue-notifications'
Vue.use(VueNotifications)
```
-Then, we add the file inside the `plugins` key of `nuxt.config.js`:
+
+
+それから `nuxt.config.js` の `plugins` キーにファイルを記述します:
+
```js
module.exports = {
plugins: ['~plugins/vue-notifications']
}
```
-To learn more about the `plugins` configuration key, check out the [plugins api](/api/configuration-plugins).
+
+
+`plugins` 設定キーについてより深く理解するには [plugins API](/api/configuration-plugins) を参照してください。
+
+
+
+実は `vue-notifications` は app bundle ファイルに含まれます。しかしライブラリなので、うまくキャッシュさせるために vendor bundle ファイルに含めたいとします。
-Actually, `vue-notifications` will be included in the app bundle, but because it's a library, we want to include it in the vendor bundle for better caching.
+
+
+`nuxt.config.js` を更新して vendor bundle の中に `vue-notifications` を入れます:
-We can update our `nuxt.config.js` to add `vue-notifications` in the vendor bundle:
```js
module.exports = {
build: {
@@ -81,11 +117,16 @@ module.exports = {
}
```
-## Client-side only
+
+
+## クライアントサイドのみ
+
+
-Some plugins might work **only for the browser**, you can use the `process.BROWSER_BUILD` variable to check if the plugin will run from the client-side.
+いくつかのプラグインは **ブラウザでのみ** 動作します。`process.BROWSER_BUILD` 変数を使って、そのプラグインがクライアントサイドで動作するか確認することができます。
Example:
+
```js
import Vue from 'vue'
import VueNotifications from 'vue-notifications'
@@ -95,4 +136,6 @@ if (process.BROWSER_BUILD) {
}
```
-In case you need to require some libraries only for the server, you can use the `process.SERVER_BUILD` variable set to `true` when webpack is creating the `server.bundle.js` file.
+
+
+もしサーバーサイドでのみライブラリを読み込む必要がある場合は、Webpack が `server.bundle.js` ファイルを作成するときに `true` がセットされる `process.SERVER_BUILD` 変数を使うことができます。
From ccf0932805c7f1cac2ededba3f7684cadc129243 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 00:42:46 +0900
Subject: [PATCH 013/129] Make ja/guide/plugins.md natural Japanese
---
ja/guide/plugins.md | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/ja/guide/plugins.md b/ja/guide/plugins.md
index 710985fcd..6ea60ea50 100644
--- a/ja/guide/plugins.md
+++ b/ja/guide/plugins.md
@@ -1,6 +1,6 @@
---
title: プラグイン
-description: Nuxt.js ではルートの Vue.js アプリケーションがインスタンス化される前に実行される js プラグインを定義することができます。プラグインとして自前のライブラリや外部モジュールを使うことができます。
+description: Nuxt.js では js プラグインを定義することができ、それはルートの Vue.js アプリケーションがインスタンス化される前に実行されます。プラグインとして自前のライブラリを指定することも、外部のモジュールを指定することもできます。
---
@@ -8,23 +8,23 @@ description: Nuxt.js ではルートの Vue.js アプリケーションがイン
-> Nuxt.js ではルートの Vue.js アプリケーションがインスタンス化される前に実行される js プラグインを定義することができます。プラグインとして自前のライブラリや外部モジュールを使うことができます。
+> Nuxt.js では js プラグインを定義することができ、それはルートの Vue.js アプリケーションがインスタンス化される前に実行されます。プラグインとして自前のライブラリを指定することも、外部のモジュールを指定することもできます。
-
+
+
-## The fetch Method
+## fetch メソッド
-> The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+
-More information about the fetch method: [API Pages fetch](/api/pages-fetch)
+fetch メソッドは、ページがレンダリングされる前に、データをストアに入れるために使われます。コンポーネントのデータをセットしないという点を除いては data メソッドとよく似ています。
-## The nuxtServerInit Action
+
-If the action `nuxtServerInit` is defined in the store, nuxt.js will call it with the context (only from the server-side). It's useful when we have some data on the server we want to give directly to the client-side.
+fetch メソッドについてより深く理解するためには [API Pages fetch](/api/pages-fetch) を参照してください。
-For example, let's say we have sessions on the server-side and we can access the connected user trough `req.session.user`. To give the authenticated user to our store, we update our `store/index.js` to the following:
+
+
+## nuxtServerInit アクション
+
+
+
+`nuxtServerInit` というアクションがストア内に定義されているときは、Nuxt.js はそれを context とともに呼び出します(サーバーサイドでのみ)。クライアントサイドに直接渡したいデータがサーバー上にあるときに便利です。
+
+
+
+例えば、サーバーサイドでセッションを持っていて、接続しているユーザーに `req.session.user` を通してアクセスできるとします。認証されたユーザーにストアを渡すために `store/index.js` 下記のように書き換えます:
```js
actions: {
@@ -184,6 +239,10 @@ actions: {
}
```
-> If you are using the _Modules_ mode of the Vuex store, only the primary module (in `store/index.js`) will receive this action. You'll need to chain your module actions from there.
+
+
+> もし Vuex ストアの _モジュール_ モードを使っているなら、(`store/index.js` 内の)プライマリモードのみ、このアクションを受け取ることができます。そこからモジュールのアクションをつなぐ必要があります。
The context is given to `nuxtServerInit` as the 2nd argument, it is the same as the `data` or `fetch` method except that `context.redirect()` and `context.error()` are omitted.
+
+context は `nuxtServerInit` へ第二引数として渡されます。`context.redirect()` や `context.error()` が除外される点を除いては `data` メソッドや `fetch` メソッドと共通しています。
From c5aefff56687fcde350abdc95a57f15100766523 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 22:46:17 +0900
Subject: [PATCH 017/129] Make ja/guide/vuex-store.md natural
---
ja/guide/vuex-store.md | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/ja/guide/vuex-store.md b/ja/guide/vuex-store.md
index 2244a940d..7bfb67bcf 100644
--- a/ja/guide/vuex-store.md
+++ b/ja/guide/vuex-store.md
@@ -1,6 +1,6 @@
---
title: Vuex ストア
-description: 状態を管理するためにストアを使うことはすべての大規模なアプリケーションにとって重要です。Nuxt.js が Vuex をコアに組み入れたのはそのような理由からです。
+description: 状態を管理してくれる Vuex ストアは、あらゆる大規模アプリケーションにとても役に立ちます。Nuxt.js が Vuex をコアに組み入れたのはそのような理由からです。
---
@@ -8,7 +8,7 @@ description: 状態を管理するためにストアを使うことはすべて
-> 状態を管理するためにストアを使うことはすべての大規模なアプリケーションにとって重要です。Nuxt.js が [Vuex](https://github.com/vuejs/vuex) をコアに組み入れたのはそのような理由からです。
+> 状態を管理してくれる Vuex ストアは、あらゆる大規模アプリケーションにとても役に立ちます。Nuxt.js が [Vuex](https://github.com/vuejs/vuex) をコアに組み入れたのはそのような理由からです。
@@ -16,25 +16,25 @@ description: 状態を管理するためにストアを使うことはすべて
-Nuxt.js は `store` ディレクトが存在するときにはそちらを探しに行きます:
+Nuxt.js は `store` ディレクトが存在するときにはそちらを探索します:
1. Vuex をインポートします
-2. `vuex` もモジュールを vendor のバンドルファイルに追加します
+2. `vuex` モジュールを vendor のバンドルファイルに追加します
3. `store` オプションをルートの `Vue` インスタンスに追加します
-Nuxt.js では **2つのモードのストア** を持つことができます。いずれか好みのほうを選んでください:
+Nuxt.js では **2つのモードのストア** があります。どちらか好みのほうを選んで使ってください:
-- **クラシック:** `store/index.js` がストアインスタンスを返します
-- **モジュール:** `store` ディレクトリ内のすべての `.js` ファイルが [Namespaced モジュール](http://vuex.vuejs.org/en/modules.html) に変換されます(`index` はルートモジュールとして存在します)
+- **クラシックモード:** `store/index.js` がストアインスタンスを返します
+- **モジュールモード:** `store` ディレクトリ内のすべての `.js` ファイルが [モジュール](http://vuex.vuejs.org/en/modules.html) に変換されます(`index` はルートモジュールとして存在します)
@@ -85,7 +85,7 @@ export default store
-このオプションを使いたいときは、ストアインスタンスの代わりに、`store/index.js` 内のストア、ミューテーション、アクションをエクスポートしてください:
+このオプションを使いたいときは、ストアインスタンスの代わりに、`store/index.js` 内のストア、ミューテーション、アクションをエクスポートします:
```js
export const state = {
@@ -101,7 +101,7 @@ export const mutations = {
-すると次のような `store/todos.js` ファイルを持つことができます:
+また、次のような `store/todos.js` ファイルを作成できます:
```js
export const state = {
@@ -215,7 +215,7 @@ fetch メソッドは、ページがレンダリングされる前に、デー
-fetch メソッドについてより深く理解するためには [API Pages fetch](/api/pages-fetch) を参照してください。
+fetch メソッドについてより深く理解するためには [ページの fetch メソッド API](/api/pages-fetch) を参照してください。
@@ -223,11 +223,11 @@ fetch メソッドについてより深く理解するためには [API Pages fe
-`nuxtServerInit` というアクションがストア内に定義されているときは、Nuxt.js はそれを context とともに呼び出します(サーバーサイドでのみ)。クライアントサイドに直接渡したいデータがサーバー上にあるときに便利です。
+`nuxtServerInit` というアクションがストア内に定義されているときは、Nuxt.js はそれを context とともに呼び出します(ただしサーバーサイドに限ります)。サーバー上に、クライアントサイドに直接渡したいデータがあるときに便利です。
-例えば、サーバーサイドでセッションを持っていて、接続しているユーザーに `req.session.user` を通してアクセスできるとします。認証されたユーザーにストアを渡すために `store/index.js` 下記のように書き換えます:
+例えば、サーバーサイドでセッションを持っていて、接続しているユーザーに `req.session.user` を通じてアクセスできるとします。認証されたユーザーにストアを渡すために `store/index.js` 下記のように書き換えます:
```js
actions: {
@@ -241,8 +241,8 @@ actions: {
-> もし Vuex ストアの _モジュール_ モードを使っているなら、(`store/index.js` 内の)プライマリモードのみ、このアクションを受け取ることができます。そこからモジュールのアクションをつなぐ必要があります。
+> もし Vuex ストアの _モジュール_ モードを使っているなら、(`store/index.js` 内の)プライマリモードのみ、このアクションを受け取ることができます。そこからモジュールのアクションをつなぐ必要があります。(訳注: 訳に自信なし。原文は If you are using the _Modules_ mode of the Vuex store, only the primary module (in `store/index.js`) will receive this action. You'll need to chain your module actions from there.)
-The context is given to `nuxtServerInit` as the 2nd argument, it is the same as the `data` or `fetch` method except that `context.redirect()` and `context.error()` are omitted.
+
context は `nuxtServerInit` へ第二引数として渡されます。`context.redirect()` や `context.error()` が除外される点を除いては `data` メソッドや `fetch` メソッドと共通しています。
From b9218db2cd6b13b978464e64b308755d860d6b1a Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 22:48:25 +0900
Subject: [PATCH 018/129] Make ja/lang.json natural
---
ja/lang.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ja/lang.json b/ja/lang.json
index d7f32a139..e12c28e76 100644
--- a/ja/lang.json
+++ b/ja/lang.json
@@ -12,7 +12,7 @@
"get_started": "はじめる",
"github": "Github",
"guide": "Guide",
- "homepage": "ホームページ",
+ "homepage": "ホーム",
"live_demo": "ライブデモ",
"live_edit": "ライブエディット",
"twitter": "Twitter",
From a71faa7223ff44045af3be7faf777eff60723919 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 23:21:14 +0900
Subject: [PATCH 019/129] Make ja/guide/index.md natural
---
ja/guide/index.md | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/ja/guide/index.md b/ja/guide/index.md
index c2967d12b..b4f2ba85e 100644
--- a/ja/guide/index.md
+++ b/ja/guide/index.md
@@ -1,6 +1,6 @@
---
title: はじめに
-description: "2016年10月25日 zeit.co のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク Next.js を発表しました。そしてその発表から数時間後、Next.js と同じやり方で Vue.js をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち Nuxt.js の誕生です。"
+description: "2016年10月25日、zeit.co のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク Next.js を発表しました。そしてその発表から数時間後、Next.js と同じやり方で、しかし今度は Vue.js をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち Nuxt.js の誕生です。"
---
@@ -8,7 +8,7 @@ description: "2016年10月25日 zeit.co のチームが React アプリケーシ
-> 2016年10月25日、[zeit.co](https://zeit.co/) のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク [Next.js](https://zeit.co/blog/next) を発表しました。そしてその発表からわずか数時間後、Next.js と同じやり方で [Vue.js](https://vuejs.org) をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち **Nuxt.js** の誕生です。
+> 2016年10月25日、[zeit.co](https://zeit.co/) のチームが React アプリケーションをサーバーサイドレンダリングするためのフレームワーク [Next.js](https://zeit.co/blog/next) を発表しました。そしてその発表からわずか数時間後、Next.js と同じやり方で、しかし今度は [Vue.js](https://vuejs.org) をサーバーサイドレンダリングするアプリケーションを構築するアイディアが生まれました。すなわち **Nuxt.js** の誕生です。
@@ -20,15 +20,15 @@ Next.js とはユニバーサルな Vue.js アプリケーションを構築す
-クライアントサイドとサーバーサイドのディストリビューションを抽象化する間の **UI レンダリング** に焦点を当てています。
+クライアントサイドとサーバーサイドのディストリビューションを抽象化している間の **UI レンダリング** に焦点を当てています。
-私たちのゴールは、あるプロジェクトの基礎として利用したり、あるいは既に進行中の Node.js ベースのプロジェクトに追加するために十分に柔軟なフレームワークを作成することです。
+私たちのゴールは、あるプロジェクトの基礎として利用したり、あるいは既に進行中の Node.js ベースのプロジェクトに追加できる、柔軟なフレームワークを作成することです。
-Nuxt.js は **サーバーサイドレンダリング** する Vue.js アプリケーションの開発をもっと楽しくするために必要な全ての設定をあらかじめ用意しています。
+Nuxt.js は **サーバーサイドレンダリング** する Vue.js アプリケーションの開発をもっと楽しくするために必要な設定を用意しています。
@@ -37,7 +37,7 @@ Nuxt.js は **サーバーサイドレンダリング** する Vue.js アプリ
-Nuxt.js はフレームワークとして、クライアントサイドとサーバーサイド間にまたがる開発を手助けするたくさんの機能を備えています。例えば、同期でのデータをやり取りや、ミドルウェアやレイアウトなどです。
+Nuxt.js はフレームワークとして、クライアントサイドとサーバーサイド間にまたがる開発を手助けする、たくさんの機能を備えています。例えば、非同期でのデータをやり取りや、ミドルウェアやレイアウトなどです。
@@ -51,7 +51,7 @@ Nuxt.js はリッチなウェブアプリケーションを構築するために
- [Vue 2](https://github.com/vuejs/vue)
- [Vue-Router](https://github.com/vuejs/vue-router)
-- [Vuex](https://github.com/vuejs/vuex)([store option](/guide/vuex-store) を利用しているときに限ります)
+- [Vuex](https://github.com/vuejs/vuex)([Vuex ストアのオプション](/guide/vuex-store) を利用しているときに限ります)
- [Vue-Meta](https://github.com/declandewet/vue-meta)
@@ -60,7 +60,7 @@ Nuxt.js はリッチなウェブアプリケーションを構築するために
-また、バンドルやコード分割及びミニファイするために [Webpack](https://github.com/webpack/webpack) を [vue-Loader](https://github.com/vuejs/vue-loader) と [babel-loader](https://github.com/babel/babel-loader) と合わせて使います。
+また、ソースコードのバンドルや分割及びミニファイするために [Webpack](https://github.com/webpack/webpack) を使います。[vue-Loader](https://github.com/vuejs/vue-loader) と [babel-loader](https://github.com/babel/babel-loader) も合わせて使います。
@@ -78,10 +78,10 @@ Nuxt.js はリッチなウェブアプリケーションを構築するために
- Vue ファイルで記述できること
-- コードの自動分割
+- コードを自動的に分割すること
- サーバーサイドレンダリング
- 非同期データを伴うパワフルなルーティング
-- 静的なファイル配信
+- 静的なファイルの配信
- ES6/ES7 のトランスパイレーション
- JS と CSS のバンドル及びミニファイ
- Head タグ(訳注: メタタグ)の管理
@@ -94,7 +94,7 @@ Nuxt.js はリッチなウェブアプリケーションを構築するために
-下の図は、サーバーサイドで実行時やユーザーが `` を通して遷移したときに Nuxt.js によって何が呼ばれるかを表しています。
+下の図は、サーバーサイドで処理が実行されたときや、ユーザーが `` を通して遷移したときに、Nuxt.js によって何が呼び出されるかを表しています:

@@ -108,15 +108,15 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-`nuxt` コマンドを実行すると、ホットリローディング及び自動的にアプリケーションをサーバーサイドレンダリングするよう設定された vue-server-render を備えた開発サーバーが起動されます。
+`nuxt` コマンドを実行すると開発サーバーが起動されます。このサーバーはホットリローディング及び vue-server-render を備えており、vue-server-render は自動的にアプリケーションをサーバーサイドレンダリングするよう設定されています。
-コマンドについてより深く学ぶには [コマンド](/guide/commands) を参照してください。
+コマンドについてより深く理解するには [コマンド](/guide/commands) を参照してください。
-既にサーバーがあるなら Nuxt.js をミドルウェアとして追加ことができます。ユニバーサルなウェブアプリケーションを開発するために Nuxt.js を利用するにあたって何も制限はありません。[Using Nuxt.js Programmatically](/api/nuxt) ガイドを見てみてください。
+既にサーバーがあるならば Nuxt.js をミドルウェアとして追加ことができます。ユニバーサルなウェブアプリケーションを開発するために Nuxt.js を利用するにあたって何も制限はありません。[Nuxt.js](/api/nuxt) ガイドを見てみてください。
@@ -128,11 +128,11 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-`nuxt generate` はアプリケーションをビルドする際に、すべてのルーティングの状態をファイル中に保存した HTML を生成します。
+`nuxt generate` はアプリケーションをビルドする際に、各ルートごとの HTML を生成します。
-例:
+例えば、下記のファイル群がある場合:
```bash
-| pages/
@@ -142,7 +142,7 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-下記を生成します:
+次のファイルが生成されます:
```
-| dist/
@@ -153,7 +153,7 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-このやり方により、どんな静的なホスティングサービスでも、生成されたウェブアプリケーションをホストすることができるようになります。
+このやり方により、静的なファイルをホスティングするサービスであっても、生成されたウェブアプリケーションをホストできます。
@@ -167,7 +167,7 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-私たちは [docs リポジトリ](https://github.com/nuxt/docs) を更新するたびに毎回手動でアプリケーションを生成したくなかったので、AWS Lambda funtion から生成機能を実行しています:
+私たちは [docs リポジトリ](https://github.com/nuxt/docs) を更新するたびに毎回手動でアプリケーションを生成するのは面倒だったので、AWS Lambda funtion から生成機能を実行しています:
@@ -185,4 +185,4 @@ Nuxt.js をプロジェクトの UI レンダリング全体を担うフレー
-さらに進めて `nuxt generate` で生成された E コマースのウェブアプリケーションを考えてみましょう。そのアプリケーションは CDN でホストされ、商品が在庫切れになったり入荷されたりするたびにアプリケーションが再生成されます。ユーザーがアプリケーション遷移している間に、在庫の状態が(再生成のおかげで)最新の状態になるのです。つまり、サーバーで複数のインスタンス及びキャッシュを持つ必要がなくなるのです!
+さらに進めて `nuxt generate` で生成された E コマースのウェブアプリケーションを考えてみましょう。そのアプリケーションは CDN でホストされ、商品が在庫切れになったり入荷されたりするたびにアプリケーションが再生成されます。ユーザーがアプリケーション遷移している間に、在庫の状態が(再生成のおかげで)最新の状態になるのです。つまり、サーバーでいろいろなインスタンスを起動したり、キャッシュを持ったりする必要がなくなるのです!
From 64fd61c07df77a71f1f31d7192fb139d60fe74bf Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 24 Feb 2017 23:27:02 +0900
Subject: [PATCH 020/129] Make ja/guide/contribution-guide.md natural
---
ja/guide/contribution-guide.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ja/guide/contribution-guide.md b/ja/guide/contribution-guide.md
index 976473294..76a69f0f1 100644
--- a/ja/guide/contribution-guide.md
+++ b/ja/guide/contribution-guide.md
@@ -1,6 +1,6 @@
---
title: 貢献ガイド
-description: "Nuxt.js へのどんな貢献も大歓迎します!"
+description: Nuxt.js への貢献はどんなものでも大歓迎です!
---
@@ -8,7 +8,7 @@ description: "Nuxt.js へのどんな貢献も大歓迎します!"
-Nuxt.js へのどんな貢献も大歓迎します!
+Nuxt.js への貢献はどんなものでも大歓迎です!
@@ -24,7 +24,7 @@ Nuxt.js へのどんな貢献も大歓迎します!
-たとえそれが単にタイポの修正であっても、ぜひプルリクエストを送ってください。どんな重要な改善であっても、誰かが手を動かし始める前に [GitHub issue](https://github.com/nuxt/nuxt.js/issues) に記載してください。
+たとえそれが単にタイプミスの修正であっても、ぜひプルリクエストを送ってください。どんな重要な改善であっても、誰かが手を動かし始める前に [GitHub issue](https://github.com/nuxt/nuxt.js/issues) に記載してください。
From 430545ea8cd4269749adf238c1d48b185b1d78f0 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Sat, 25 Feb 2017 19:09:05 +0900
Subject: [PATCH 021/129] Translate ja/guide/commands.md
---
ja/guide/commands.md | 105 ++++++++++++++++++++++++++++++++-----------
1 file changed, 79 insertions(+), 26 deletions(-)
diff --git a/ja/guide/commands.md b/ja/guide/commands.md
index aab7fce28..7c473353b 100644
--- a/ja/guide/commands.md
+++ b/ja/guide/commands.md
@@ -1,20 +1,36 @@
---
-title: Commands
-description: Nuxt.js comes with a set of useful commands, both for development and production purpose.
+title: コマンド
+description: Nuxt.js はひととおりの便利コマンドを備えています。開発用途のものもプロダクション用途のものもあります。
---
-> Nuxt.js comes with a set of useful commands, both for development and production purpose.
+
+
-## List of Commands
+
-| Command | Description |
+> Nuxt.js はひととおりの便利コマンドを備えています。開発用途のものもプロダクション用途のものもあります。
+
+
+
+## コマンド一覧
+
+
+
+
+
+
+
+
+| コマンド | 説明 |
|---------|-------------|
-| nuxt | Launch a development server on [localhost:3000](http://localhost:3000) with hot-reloading. |
-| nuxt build | Build your application with webpack and minify the JS & CSS (for production). |
-| nuxt start | Start the server in production mode (After running `nuxt build`). |
-| nuxt generate | Build the application and generate every route as a HTML file (used for static hosting). |
+| nuxt | 開発サーバーを [localhost:3000](http://localhost:3000) で起動します。このサーバーはホットリローディングします。 |
+| nuxt build | アプリケーションを Webpack でビルドし、JS と CSS をプロダクション向けにミニファイします。 |
+| nuxt start | プロダクションモードでサーバーを起動します(`nuxt build` 後に実行してください) |
+| nuxt generate | アプリケーションをビルドして、ルートごとに HTML ファイルを生成します(静的ファイルのホスティングに用います) |
+
+
-You should put these commands in the `package.json`:
+これらのコマンドを `package.json` に書いておくと良いでしょう:
```json
"scripts": {
@@ -25,32 +41,55 @@ You should put these commands in the `package.json`:
}
```
-Then, you can launch your commands via `npm run ` (example: `npm run dev`).
+
+
+そうすれば、`npm run ` 経由で Nuxt.js のコマンドを実行することができます(例: `npm run dev`)
-## Development Environment
+
-To launch Nuxt in development mode with the hot reloading:
+## 開発環境
+
+
+
+Nuxt.js をホットリローディングする開発モードで起動するには:
+
+
+
+
+
+
```bash
nuxt
-// OR
+// または
npm run dev
```
-## Production Deployment
+
+
+## プロダクション環境へのデプロイ
+
+
-Nuxt.js lets your choose between 2 modes to deploy your application: Server Rendered or Static Generated.
+Nuxt.js ではアプリケーションをデプロイするための 2つのモードから選べます: サーバーサイドレンダリングするモードと静的なファイルを生成するモードです。
-### Server Rendered Deployment
+
-To deploy, instead of running nuxt, you probably want to build ahead of time. Therefore, building and starting are separate commands:
+### サーバーサイドレンダリングモードのデプロイ
+
+
+
+デプロイするために、nuxt コマンドを実行するのではなく、前もってビルドしたいと思われるでしょう。そのような理由から、ビルドとサーバー起動は分離されています:
```bash
nuxt build
nuxt start
```
-The `package.json` like follows is recommended:
+
+
+`package.json` では下記のように記述することが推奨されています:
+
```json
{
"name": "my-app",
@@ -65,20 +104,34 @@ The `package.json` like follows is recommended:
}
```
-Note: we recommend putting `.nuxt` in `.npmignore` or `.gitignore`.
+
+
+メモ: `.npmignore` または `.gitignore` 内に `.nuxt` を書いておくことをお勧めします。
+
+
-### Static Generated Deployment
+### 静的に生成されたファイルのデプロイ
-Nuxt.js gives you the possibility to host your web application on any static hosting.
+
-To generate our web application into static files:
+Nuxt.js により、静的なファイルのホスティングサービスで、ウェブアプリケーションをホストすることができます。
+
+
+
+アプリケーションから静的なファイルを生成するには:
```bash
npm run generate
```
-It will create a `dist` folder with everything inside ready to be deployed on a static hosting.
+
+
+`dist` フォルダが作成され、その中に静的なファイルのホスティングサービスにデプロイされるべきものがすべて入ります。
+
+
+
+プロジェクトで [動的なルーティング](/guide/routing#dynamic-routes) を使っている場合は、Nuxt.js に動的なルーティングを生成させるために [generate 設定](/api/configuration-generate) に目を通してください。
-If you have a project with [dynamic routes](/guide/routing#dynamic-routes), take a look at the [generate configuration](/api/configuration-generate) to tell nuxt.js how to generate these dynamic routes.
+
-
When generating your web application with `nuxt generate`, [the context](/api#context) given to [data()](/guide/async-data#the-data-method) and [fetch()](/guide/vuex-store#the-fetch-method) will not have `req` and `res`.
From 3e636572a7aab9c9a1e95d6e79d8196d02926b44 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Sat, 25 Feb 2017 21:37:17 +0900
Subject: [PATCH 029/129] Make ja/guide/async-data.md natural
---
ja/guide/async-data.md | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/ja/guide/async-data.md b/ja/guide/async-data.md
index b99db8c1f..892596339 100644
--- a/ja/guide/async-data.md
+++ b/ja/guide/async-data.md
@@ -1,6 +1,6 @@
---
title: 非同期なデータ
-description: Nuxt.js は、コンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の data メソッドを過給します
+description: Nuxt.js はコンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の data メソッドに手を加えています。
---
@@ -8,7 +8,7 @@ description: Nuxt.js は、コンポーネントのデータをセットする
-> Nuxt.js は、コンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の `data` メソッドを *過給* します(訳注: supercharges をうまく訳せませんでした。原文は Nuxt.js *supercharges* the `data` method from vue.js to let you handle async operation before setting the component data.)
+> Nuxt.js はコンポーネントのデータをセットする前に非同期の処理を行えるようにするために、Vue.js の `data` メソッドに手を加えています。
@@ -24,9 +24,7 @@ description: Nuxt.js は、コンポーネントのデータをセットする
-To make the data method asynchronous, nuxt.js offers you different ways, choose the one you're the most familiar with:
-
-Nuxt.js では data メソッドを非同期にするために、いくつかの異なるやり方があるので、最もなじむものを選択してください:
+Nuxt.js では data メソッドを非同期にするために、いくつかの異なるやり方があるので、お好きなものを選んでください:
@@ -85,7 +83,7 @@ export default {
-もし非同期に実行する必要がなければ、シンプルにオブジェクトを返せば良いです:
+もし非同期に実行する必要がなければ、シンプルにオブジェクトを返すことができます:
```js
export default {
@@ -115,7 +113,7 @@ data メソッドがセットされると、下記のように template の内
-`context` 内で利用できるキーの一覧を確認するには [ページ data API](/api) をご覧ください。
+`context` 内で利用できるキーの一覧を確認するには [ページ data API](/api) を参照してください。
@@ -123,7 +121,7 @@ data メソッドがセットされると、下記のように template の内
-Nuxt.js は `context` の中に `error(params)` メソッドを追加しました。これを呼び出すことでエラーページを表示できます。
+Nuxt.js は `context` の中に `error(params)` メソッドを追加しています。これを呼び出すことでエラーページを表示できます。
From c2d13fa5f64506792b850c135e8757f43511dd57 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Sat, 25 Feb 2017 22:40:35 +0900
Subject: [PATCH 030/129] Translate ja/guide/development-tools.md
---
ja/guide/development-tools.md | 167 ++++++++++++++++++++++++++++------
ja/guide/installation.md | 4 +-
2 files changed, 141 insertions(+), 30 deletions(-)
diff --git a/ja/guide/development-tools.md b/ja/guide/development-tools.md
index 0d1b745f5..ffdef71dd 100644
--- a/ja/guide/development-tools.md
+++ b/ja/guide/development-tools.md
@@ -1,20 +1,34 @@
---
-title: Development Tools
-description: Nuxt.js helps you to make your web development enjoyable.
+title: 開発ツール
+description: Nuxt.js は開発がより楽しいものになるよう手助けします。
---
-> Testing your application is part of the web development. Nuxt.js helps you to make it as easy as possible.
+
+
-## End-to-End Testing
+
-[Ava](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.
+> アプリケーションをテストすることはウェブ開発の一部です。Nuxt.js は可能な限り簡単にテストできるようにしています。
+
+
+
+## エンドツーエンドテスト
+
+
+
+[Ava](https://github.com/avajs/ava) は [jsdom](https://github.com/tmpvar/jsdom) と合わせて使うことができる、JavaScript のパワフルなテスティングフレームワークです。エンドツーエンドテストを簡単に行うためにこれらを使うことができます。
+
+
+
+まず ava と jsdom を開発依存パッケージに追加する必要があります:
-First, we need to add ava and jsdom as development dependencies:
```bash
npm install --save-dev ava jsdom
```
-And add a test script to our `package.json`:
+
+
+それから `package.json` に test というスクリプトを追加します:
```javascript
"scripts": {
@@ -22,12 +36,18 @@ And add a test script to our `package.json`:
}
```
-We are going to write our tests in the `test` folder:
+
+
+`test` フォルダ内にテストを書いていくことにします:
+
```bash
mkdir test
```
-Let's says we have a page in `pages/index.vue`:
+
+
+`pages/index.vue` にページががあります:
+
```html
Hello {{ name }}!
@@ -48,21 +68,72 @@ export default {
```
-When we launch our app with `npm run dev` and open [http://localhost:3000](http://localhost:3000), we can see our red `Hello world!` title.
+
+
+`npm run dev` でアプリケーションを起動し [http://localhost:3000](http://localhost:3000) を開いているとき、`Hello world!` というタイトルが表示されています。
+
+
+
+`test/index.test.js` というテストファイルを追加します:
+
+
+
+
+
+
+
+
+
+
-We add our test file `test/index.test.js`:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```js
import test from 'ava'
import Nuxt from 'nuxt'
import { resolve } from 'path'
-// We keep the nuxt and server instance
-// So we can close them at the end of the test
+// nuxt と server インスタンスを保持します
+// そうすればテスト終了時にそれらをクローズできます
let nuxt = null
let server = null
-// Init Nuxt.js and create a server listening on localhost:4000
+// Nuxt.js を初期化し localhost:4000 でリスニングするサーバーを作成します
test.before('Init Nuxt.js', async t => {
const rootDir = resolve(__dirname, '..')
let config = {}
@@ -75,14 +146,14 @@ test.before('Init Nuxt.js', async t => {
server.listen(4000, 'localhost')
})
-// Example of testing only generated html
+// 生成された HTML のみをテストする例
test('Route / exits and render HTML', async t => {
let context = {}
const { html } = await nuxt.renderRoute('/', context)
t.true(html.includes('
Hello world!
'))
})
-// Example of testing via dom checking
+// DOM を経由してチェックするテストの例
test('Route / exits and render HTML with CSS applied', async t => {
const window = await nuxt.renderAndGetWindow('http://localhost:4000/')
const element = window.document.querySelector('.red')
@@ -92,31 +163,62 @@ test('Route / exits and render HTML with CSS applied', async t => {
t.is(window.getComputedStyle(element).color, 'red')
})
-// Close server and ask nuxt to stop listening to file changes
+// サーバーを閉じて nuxt にファイル更新のリスニングを中止させる
test.after('Closing server and nuxt.js', t => {
server.close()
nuxt.close()
})
```
-We can now launch our tests:
+
+
+テストを実行できるようになっています:
+
```bash
npm test
```
-jsdom has some limitations because it does not use a browser. However, it will cover most of our tests. If you want to use a browser to test your application, you might want to check out [Nightwatch.js](http://nightwatchjs.org).
+
+
+jsdom はブラウザを使っていないため制約がいくつかありますが、ほとんどのテストはカバーできます。もしアプリケーションをテストするためにブラウザを使いたいときは [Nightwatch.js](http://nightwatchjs.org) を調べるとよいかもしれません。
## ESLint
-> ESLint is a great tool to keep your code clean
+
+
+> ESLint はコードを綺麗に保てるすごいツールです。
+
+
-You can add [ESLint](http://eslint.org) pretty easily with nuxt.js, first, you need to add the npm dependencies:
+とても簡単に [ESLint](http://eslint.org) を Nuxt.js と一緒に使うことができます。まず npm の依存パッケージを追加する必要があります:
```bash
npm install --save-dev babel-eslint eslint eslint-config-standard eslint-plugin-html eslint-plugin-promise eslint-plugin-standard
```
-Then, you can configure ESLint via a `.eslintrc.js` file in your root project directory:
+
+
+それから `.eslintrc.js` ファイルをプロジェクトのルートディレクトに置いて ESLint を設定できます:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```js
module.exports = {
root: true,
@@ -126,17 +228,19 @@ module.exports = {
node: true
},
extends: 'standard',
- // required to lint *.vue files
+ // *.vue ファイルを lint するために必要
plugins: [
'html'
],
- // add your custom rules here
+ // ここにカスタムルールを追加します
rules: {},
globals: {}
}
```
-Then, you can add a `lint` script in your `package.json`:
+
+
+それから `lint` スクリプトを `package.json` 内に追加できます:
```js
"scripts": {
@@ -144,11 +248,18 @@ Then, you can add a `lint` script in your `package.json`:
}
```
-You can now launch:
+
+
+lint を実行できます:
+
```bash
npm run lint
```
-ESLint will lint every of your JavaScript and Vue files while ignoring your ignored files defined in your `.gitignore`.
+
+
+ESLint は `.gitignore` に定義されたファイルを無視しつつ、それ以外のすべての JavaScript と Vue ファイルを lint します。
+
+
-
One best practice is to add also `"precommit": "npm run lint"` in your package.json to lint your code automatically before commiting your code.
+
`"precommit": "npm run lint"` を package.json に追加してコードをコミットする前に自動的に lint するのはベストプラクティスのひとつです。
+
+
-## Context
+## コンテキスト
@@ -63,7 +67,7 @@ export default {
| `env` | オブジェクト | クライアント&サーバー | `nuxt.config.js` でセットされた環境変数。詳細は [env API](/api/configuration-env) を参照してください |
| `params` | オブジェクト | クライアント&サーバー | route.params のエイリアス |
| `query` | オブジェクト | クライアント&サーバー | route.query のエイリアス |
-| `req` | [http.Request](https://nodejs.org/api/http.html#http_class_http_incomingmessage) | サーバー | Node.js サーバーのリクエスト。Nuxt.js をミドルウェアとして使っているとき、req オブジェクトは利用しているフレームワークによって異なるかもしれません。*`nuxt generate` からは利用できません* |
-| `res` | [http.Response](https://nodejs.org/api/http.html#http_class_http_serverresponse) | サーバー | Node.js サーバーのレスポンス。Nuxt.js をミドルウェアとして使っているとき、req オブジェクトは利用しているフレームワークによって異なるかもしれません。*`nuxt generate` からは利用できません* |
-| `redirect` | 関数 | クライアント&サーバー | 別のルートにリダイレクトさせたいときに使います。サーバーサイドで使われるステータスコードはデフォルトで 302 です。`redirect([status,] path [, query])` |
+| `req` | [http.Request](https://nodejs.org/api/http.html#http_class_http_incomingmessage) | サーバー | Node.js サーバーのリクエスト。Nuxt.js をミドルウェアとして使っているとき、req オブジェクトは利用しているフレームワークによって異なります。*`nuxt generate` からは利用できません* |
+| `res` | [http.Response](https://nodejs.org/api/http.html#http_class_http_serverresponse) | サーバー | Node.js サーバーのレスポンス。Nuxt.js をミドルウェアとして使っているとき、res オブジェクトは利用しているフレームワークによって異なります。*`nuxt generate` からは利用できません* |
+| `redirect` | 関数 | クライアント&サーバー | 別のルートにリダイレクトさせたいときに使います。サーバーサイドで使われるステータスコードはデフォルトで 302 です: `redirect([status,] path [, query])` |
| `error` | 関数 | クライアント&サーバー | エラーページを表示させたいときに使います: `error(params)`。`params` は `statusCode` と `message` というフィールドを持っている必要があります |
diff --git a/ja/guide/async-data.md b/ja/guide/async-data.md
index fbb7b8c15..eb375ce02 100644
--- a/ja/guide/async-data.md
+++ b/ja/guide/async-data.md
@@ -16,7 +16,7 @@ description: Nuxt.js はコンポーネントのデータをセットする前
-`data` メソッドはコンポーネント(ページコンポーネントに限ります)が読み込まれる前に毎回呼び出されます。サーバーサイドレンダリングや、ユーザーがページを遷移する前にも呼び出されます。そしてこのメソッドは第一引数として [context](/api#context) を受け取り、context を、データをフェッチしたりコンポーネントのデータを返すために使うことができます。
+`data` メソッドはコンポーネント(ページコンポーネントに限ります)が読み込まれる前に毎回呼び出されます。サーバーサイドレンダリングや、ユーザーがページを遷移する前にも呼び出されます。そしてこのメソッドは第一引数として [context](/api#context) を受け取り、context を使ってデータを取得してコンポーネントのデータを返すことができます。
From bb789066db09325610645f0d14bd7c94788d15c4 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 27 Feb 2017 20:58:36 +0900
Subject: [PATCH 035/129] Translate ja/api/pages-fetch.md
---
ja/api/index.md | 2 +-
ja/api/pages-fetch.md | 36 +++++++++++++++++++++++++++---------
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/ja/api/index.md b/ja/api/index.md
index 7bc1e62f9..435e61012 100644
--- a/ja/api/index.md
+++ b/ja/api/index.md
@@ -20,7 +20,7 @@ description: Nuxt.js は Vue.js の data メソッドに手を加えて、コン
-`data` はコンポーネントがローディングされる前に毎回呼び出されます(ページコンポーネントに限ります)。サーバーサイドもしくは(訳注: クライアントサイドでは)ユーザーがページ遷移する前に呼び出されます。このメソッドは **context** を第一引数として受け取り、context を使ってデータを取得してコンポーネントのデータを返すことができます。
+`data` はコンポーネントがローディングされる前に毎回呼び出されます(ページコンポーネントに限ります)。サーバーサイドもしくは(訳注: クライアントサイドでは)ユーザーがページ遷移する前に呼び出されます。このメソッドは第一引数として **context** を受け取り、context を使ってデータを取得してコンポーネントのデータを返すことができます。
```js
export default {
diff --git a/ja/api/pages-fetch.md b/ja/api/pages-fetch.md
index aa8cf8c72..0bcf04280 100644
--- a/ja/api/pages-fetch.md
+++ b/ja/api/pages-fetch.md
@@ -1,19 +1,35 @@
---
-title: "API: The fetch Method"
-description: The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+title: "API: fetch メソッド"
+description: fetch メソッドは、ページがレンダリングされる前に、データをストアに入れるために使われます。コンポーネントのデータをセットしないという点を除いては data メソッドとよく似ています。
---
-# The fetch Method
+
+
-> The fetch method is used to fill the store before rendering the page, it's like the data method except it doesn't set the component data.
+
-- **Type:** `Function`
+# fetch メソッド
-The `fetch` method, *if set*, is called every time before loading the component (**only for pages components**). It can be called from the server-side or before navigating to the corresponding route.
+
-The `fetch` method receives [the context](/api#context) as the first argument, we can use it to fetch some data and fill the store. To make the fetch method asynchronous, **return a Promise**, nuxt.js will wait for the promise to be resolved before rendering the Component.
+> fetch メソッドは、ページがレンダリングされる前に、データをストアに入れるために使われます。コンポーネントのデータをセットしないという点を除いては data メソッドとよく似ています。
+
+
+
+- **タイプ:** `関数`
+
+
+
+`fetch` メソッドは、*もしセットされていれば*、コンポーネントがローディングされる前に毎回呼び出されます(**ページコンポーネントに限ります**)。サーバーサイドもしくは(訳注: クライアントサイドでは)ユーザーがページ遷移する前に呼び出されます。
+
+
+
+`fetch` メソッドは第一引数として [context](/api#context) を受け取り、context を使ってデータを取得してデータをストアに入れることができます。fetch メソッドを非同期にするためには **Promise を返すようにしてください**。Nuxt.js はコンポーネントがレンダリングされる前に Promise が解決されるまで待ちます。
+
+
+
+`pages/index.vue` の例:
-Example of `pages/index.vue`:
```html
Stars: {{ $store.state.stars }}
@@ -31,7 +47,9 @@ export default {
```
-You can also use async/await to make your code cleaner:
+
+
+async/await を使ってコードをスッキリさせることもできます:
```html
From 8c2215cddc1b8cd13c62a223fec4d37bd82789a7 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Mon, 27 Feb 2017 21:12:47 +0900
Subject: [PATCH 036/129] Translate ja/api/pages-head.md
---
ja/api/pages-head.md | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/ja/api/pages-head.md b/ja/api/pages-head.md
index 7df5436d6..d63e42b1f 100644
--- a/ja/api/pages-head.md
+++ b/ja/api/pages-head.md
@@ -1,17 +1,30 @@
---
-title: "API: The head Method"
-description: Nuxt.js uses vue-meta to update the `headers` and `html attributes` of your application.
+title: "API: head メソッド"
+description: Nuxt.js はアプリケーションの `headers` 及び `html attributes` を更新するために vue-meta と使います。
---
-# The head Method
+
+
-> Nuxt.js uses [vue-meta](https://github.com/declandewet/vue-meta) to update the `headers` and `html attributes` of your application.
+
-- **Type:** `Object` or `Function`
+# head メソッド
-Use the `head` method to set the HTML Head tags for the current page.
+
-Your component data are available with `this` in the `head` method, you can use set custom meta tags with the page data.
+> Nuxt.js はアプリケーションの `headers` 及び `html attributes` を更新するために [vue-meta](https://github.com/declandewet/vue-meta) を使います。
+
+
+
+- **タイプ:** `オブジェクト` または `関数`
+
+
+
+現在のページの HTML の head タグを設定するために `head` メソッド使います。
+
+
+
+コンポーネントのデータは `head` メソッド内で `this` を使って利用できます。ページのデータを使って独自のメタタグを設定することもできます。
```html
@@ -37,4 +50,6 @@ export default {
```
-
To avoid any duplication when used in child component, please give a unique identifier with the `hid` key, please [read more about it](https://github.com/declandewet/vue-meta#lists-of-tags).
**INFO:** You can use the command `nuxt build --analyzer` or `nuxt build -a` to build your application and launch the bundle analyzer on [http://localhost:8888](http://localhost:8888)
情報: ページコンポーネントでも `head` を使うことができます。`this` を経由してコンポーネントのデータにアクセスできます。[コンポーネントの head プロパティ](/api/pages-head) を参照してください。
+
情報: ページのコンポーネントでも `head` を使うことができ、`this` を経由してコンポーネントのデータにアクセスできます。詳しくは [コンポーネントの head プロパティ](/api/pages-head) を参照してください。
From c8006df40bd8d180cb91986b7c55976b5d67dc7f Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 1 Mar 2017 22:47:28 +0900
Subject: [PATCH 079/129] Translate ja/api/configuration-loading.md
---
ja/api/configuration-loading.md | 106 +++++++++++++++++++++++---------
1 file changed, 78 insertions(+), 28 deletions(-)
diff --git a/ja/api/configuration-loading.md b/ja/api/configuration-loading.md
index a1276936a..ac60c0fc4 100644
--- a/ja/api/configuration-loading.md
+++ b/ja/api/configuration-loading.md
@@ -1,19 +1,34 @@
---
-title: "API: The loading Property"
-description: Nuxt.js uses it's own component to show a progress bar between the routes. You can customize it, disable it or create your own component.
+title: "API: loading プロパティ"
+description: Nuxt.js はルートから別のルートへ遷移する間、プログレスバーを表示するために自身のコンポーネントを使います。これをカスタマイズしたり、プログレスバーを使わないようにしたり、独自のコンポーネントを作成したりできます。
---
-# The loading Property
+
+
-- Type: `Boolean` or `Object` or `String`
+
-> Nuxt.js uses it's own component to show a progress bar between the routes. You can customize it, disable it or create your own component.
+# loadding プロパティ
-## Disable the Progress Bar
+
-- Type: `Boolean`
+- タイプ: `ブーリアン` または `オブジェクト` または `文字列`
-If you don't want to display the progress bar between the routes, simply add `loading: false` in your `nuxt.config.js` file:
+
+
+> Nuxt.js はルートから別のルートへ遷移する間、プログレスバーを表示するために自身のコンポーネントを使います。これをカスタマイズしたり、プログレスバーを使わないようにしたり、独自のコンポーネントを作成したりできます。
+
+
+
+## プログレスバーを無効にする
+
+
+
+- タイプ: `ブーリアン`
+
+
+
+ルートから別のルートへ遷移する間にプログレスバーを表示したくないときは `nuxt.config.js` ファイル内に単に `loading: false` と記述します:
```js
module.exports = {
@@ -21,20 +36,35 @@ module.exports = {
}
```
-## Customize the Progress Bar
+
+
+## プログレスバーをカスタマイズする
+
+
+
+- タイプ: `オブジェクト`
-- Type: `Object`
+
-List of properties to customize the progress bar.
+プログレスバーをカスタマイズするプロパティ一覧。
-| Key | Type | Default | Description |
+
+
+
+
+
+
+
+| キー | タイプ | デフォルト | 説明 |
|-----|------|---------|-------------|
-| `color` | String | `'black'` | CSS color of the progress bar |
-| `failedColor` | String | `'red'` | CSS color of the progress bar when an error appended while rendering the route (if `data` or `fetch` sent back an error for example). |
-| `height` | String | `'2px'` | Height of the progress bar (used in the `style` property of the progress bar) |
-| `duration` | Number | `5000` | In ms, the maximum duration of the progress bar, Nuxt.js assumes that the route will be rendered before 5 seconds. |
+| `color` | 文字列 | `'black'` | プログレスバーの CSS カラー |
+| `failedColor` | 文字列 | `'red'` | 当該ルートをレンダリング中にエラーが発生した場合のプログレスバーの CSS カラー(例えば `data` または `fetch` がエラーを返したとき) |
+| `height` | 文字列 | `'2px'` | プログレスバーの高さ(プログレスバーの `style` プロパティで使われます) |
+| `duration` | 数値 | `5000` | プログレスバーの最大継続時間をミリ秒で指定します。Nuxt.js は各ルートは 5秒以内にレンダリングされると想定しています |
+
+
-For a blue progress bar with 5px of height, we update the `nuxt.config.js` to the following:
+青いプログレスバーを 5px の高さで表示するには `nuxt.config.js` を次のように更新します:
```js
module.exports = {
@@ -45,22 +75,40 @@ module.exports = {
}
```
-## Use a Custom Loading Component
+
+
+## 独自のコンポーネントを使う
+
+
+
+- タイプ: `文字列`
-- Type: `String`
+
-You can create your own component that Nuxt.js will call instead of its default component. To do so, you need to give a path to your component in the `loading` option. Then, your component will be called directly by Nuxt.js.
+Nuxt.js がデフォルトのコンポーネントの代わりに呼び出す、独自のコンポーネントを作成できます。そのためには `loading` オプション内に独自コンポーネントのパスを指定する必要があります。そうすれば独自コンポーネントは Nuxt.js により直接呼び出されます。
-**Your component has to expose some of theses methods:**
+
-| Method | Required | Description |
+**独自コンポーネントはいくつかのメソッドを使えるようにしている必要があります:**
+
+
+
+
+
+
+
+
+| メソッド | 必須か否か | 説明 |
|--------|----------|-------------|
-| `start()` | Required | Called when a route changes, this is here where you display your component. |
-| `finish()` | Required | Called when a route is loaded (and data fetched), this is here where you hide your component. |
-| `fail()` | *Optional* | Called when a route couldn't be loaded (failed to fetch data for example). |
-| `increase(num)` | *Optional* | Called during loading the route component, `num` is an Integer < 100. |
+| `start()` | 必須 | ルートが変更されたときに呼び出されます。ここが独自コンポーネントが表示される時点です |
+| `finish()` | 必須 | ルートがロード(及びデータ取得)されたときに呼び出されます。ここが独自コンポーネントが非表示になる時点です |
+| `fail()` | *必須でない* | ルートがロードできなかったときに呼び出されます(例えばデータの取得に失敗したなど) |
+| `increase(num)` | *必須でない* | ルートのコンポーネントがロードされている間に呼び出されます。`num` は 100 未満の整数です |
+
+
+
+`components/loading.vue` に独自コンポーネントを作ることができます:
-We can create our custom component in `components/loading.vue`:
```html
@@ -100,7 +148,9 @@ export default {
```
-Then, we update our `nuxt.config.js` to tell Nuxt.js to use our component:
+
+
+それから `nuxt.config.js` を更新して、独自コンポーネントを使うことを Nuxt.js に伝えます:
```js
module.exports = {
From 788a0c5d61ace844bea07b035f4f86484b529799 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 1 Mar 2017 22:58:13 +0900
Subject: [PATCH 080/129] Make ja/api/configuration-loading.md natural
---
ja/api/configuration-loading.md | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/ja/api/configuration-loading.md b/ja/api/configuration-loading.md
index ac60c0fc4..fc8a902fc 100644
--- a/ja/api/configuration-loading.md
+++ b/ja/api/configuration-loading.md
@@ -46,7 +46,7 @@ module.exports = {
-プログレスバーをカスタマイズするプロパティ一覧。
+プログレスバーをカスタマイズするために使えるプロパティ一覧。
@@ -58,13 +58,13 @@ module.exports = {
| キー | タイプ | デフォルト | 説明 |
|-----|------|---------|-------------|
| `color` | 文字列 | `'black'` | プログレスバーの CSS カラー |
-| `failedColor` | 文字列 | `'red'` | 当該ルートをレンダリング中にエラーが発生した場合のプログレスバーの CSS カラー(例えば `data` または `fetch` がエラーを返したとき) |
+| `failedColor` | 文字列 | `'red'` | ルートをレンダリング中にエラーが発生した場合のプログレスバーの CSS カラー(例えば `data` または `fetch` がエラーを返したとき) |
| `height` | 文字列 | `'2px'` | プログレスバーの高さ(プログレスバーの `style` プロパティで使われます) |
-| `duration` | 数値 | `5000` | プログレスバーの最大継続時間をミリ秒で指定します。Nuxt.js は各ルートは 5秒以内にレンダリングされると想定しています |
+| `duration` | 数値 | `5000` | プログレスバーを表示する時間の最大値をミリ秒で指定します。Nuxt.js は各ルートが 5秒以内にレンダリングされると想定しています |
-青いプログレスバーを 5px の高さで表示するには `nuxt.config.js` を次のように更新します:
+例として、青いプログレスバーを 5px の高さで表示するには `nuxt.config.js` を次のように編集します:
```js
module.exports = {
@@ -89,7 +89,7 @@ Nuxt.js がデフォルトのコンポーネントの代わりに呼び出す、
-**独自コンポーネントはいくつかのメソッドを使えるようにしている必要があります:**
+**独自コンポーネントはいくつかのメソッドを備えている必要があります:**
@@ -100,8 +100,8 @@ Nuxt.js がデフォルトのコンポーネントの代わりに呼び出す、
| メソッド | 必須か否か | 説明 |
|--------|----------|-------------|
-| `start()` | 必須 | ルートが変更されたときに呼び出されます。ここが独自コンポーネントが表示される時点です |
-| `finish()` | 必須 | ルートがロード(及びデータ取得)されたときに呼び出されます。ここが独自コンポーネントが非表示になる時点です |
+| `start()` | 必須 | ルートが変更されたときに呼び出されます。このときに独自コンポーネントの表示が開始されます |
+| `finish()` | 必須 | ルートがロード(及びデータ取得)されたときに呼び出されます。このときに独自コンポーネントが表示が終了します |
| `fail()` | *必須でない* | ルートがロードできなかったときに呼び出されます(例えばデータの取得に失敗したなど) |
| `increase(num)` | *必須でない* | ルートのコンポーネントがロードされている間に呼び出されます。`num` は 100 未満の整数です |
@@ -150,7 +150,7 @@ export default {
-それから `nuxt.config.js` を更新して、独自コンポーネントを使うことを Nuxt.js に伝えます:
+それから `nuxt.config.js` を編集して、独自コンポーネントを使うことを Nuxt.js に伝えます:
```js
module.exports = {
From 217125cd13d13b3aef80cc14ba9f47676745efe0 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 1 Mar 2017 23:10:17 +0900
Subject: [PATCH 081/129] Translate ja/api/configuration-plugins.md
---
ja/api/configuration-plugins.md | 44 ++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/ja/api/configuration-plugins.md b/ja/api/configuration-plugins.md
index 6998e0082..33358cccf 100644
--- a/ja/api/configuration-plugins.md
+++ b/ja/api/configuration-plugins.md
@@ -1,23 +1,39 @@
---
-title: "API: The plugins Property"
-description: Use vue.js plugins with the plugins option of nuxt.js.
+title: "API: plugins プロパティ"
+description: Nuxt.js の plugins オプションで Vue.js プラグインを使うことができます。
---
-# The plugins Property
+
+
-- Type: `Array`
- - Items: `String`
+
-> The plugins property lets you add vue.js plugins easily to your main application.
+# plugins プロパティ
+
+
+
+
+- タイプ: `配列`
+ - 要素: `文字列`
+
+
+
+> plugins プロパティを使うと Vue.js プラグインをメインアプリケーションに簡単に追加できます。
+
+
+
+例(`nuxt.config.js`):
-Example (`nuxt.config.js`):
```js
module.exports = {
plugins: ['~plugins/vue-notifications']
}
```
-Then, we need to create a file in `plugins/vue-notifications.js`:
+
+
+それから `plugins/vue-notifications.js` ファイルを作る必要があります:
+
```js
import Vue from 'vue'
import VueNotifications from 'vue-notifications'
@@ -25,8 +41,14 @@ import VueNotifications from 'vue-notifications'
Vue.use(VueNotifications)
```
-All the paths defined in the `plugins` property will be **imported** before initializing the main application.
+
+
+`plugins` プロパティで設定されたパスはすべて、メインアプリケーションが初期化される前に **インポート** されます。
+
+
+
+`Vue.use()` を使う必要があるときは毎回 `plugins/` 内にファイルを作成し、そのパスを `nuxt.config.js` 内の `plugins` に追加する必要があります。
-Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to `plugins` in `nuxt.config.js`.
+
-To learn more how to use the plugins, see the [guide documentation](/guide/plugins#vue-plugins).
+plugins の使い方をより深く理解するには [guide ドキュメント](/guide/plugins#vue-plugins) を参照してください。
From 70d44abea047e75c994ecafa4c64709b04d6a485 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 1 Mar 2017 23:32:39 +0900
Subject: [PATCH 082/129] Translate ja/api/configuration-rootdir.md
---
ja/api/configuration-rootdir.md | 34 ++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/ja/api/configuration-rootdir.md b/ja/api/configuration-rootdir.md
index f4570d221..906e4b2bd 100644
--- a/ja/api/configuration-rootdir.md
+++ b/ja/api/configuration-rootdir.md
@@ -1,17 +1,33 @@
---
-title: "API: The rootDir Property"
-description: Define the workspace of nuxt.js application
+title: "API: rootDir プロパティ"
+description: Nuxt.js アプリケーションのワークスペースを指定します。
---
-# The rootDir Property
+
+
-- Type: `String`
-- Default: `process.cwd()`
+
-> Define the workspace of your nuxt.js application.
+# rootDir プロパティ
-This property is overwritten by [nuxt commands](/guide/commands) and set to the argument of the command (example: `nuxt my-app/` will set the `rootDir` to `my-app/` with its absolute path).
+
+
-This property should be used when using [nuxt.js programmatically](/api/nuxt).
+- タイプ: `文字列`
+- デフォルト: `process.cwd()`
-
The downside of this option is that your `node_modules` directory should be inside the `rootDir` folder. If you want to set the path of the application without the node_modules, use the [`srcDir` option](/api/configuration-srcdir).
-> This option is given directly to the vue-router [Router constructor](https://router.vuejs.org/en/api/options.html).
+
+
+> このオプションは vue-router の [Router コンストラクタ](https://router.vuejs.org/en/api/options.html) に直接付与されます。
## linkActiveClass
-- Type: `String`
-- Default: `'nuxt-link-active'`
+
+
+
+- タイプ: `文字列`
+- デフォルト: `'nuxt-link-active'`
+
+
+
+[``](/api/components-nuxt-link) のデフォルトの active class をグローバルに設定します。
-Globally configure [``](/api/components-nuxt-link) default active class.
+
+
+例(`nuxt.config.js`):
-Example (`nuxt.config.js`):
```js
module.exports = {
router: {
@@ -43,32 +70,66 @@ module.exports = {
}
```
-> This option is given directly to the [vue-router Router constructor](https://router.vuejs.org/en/api/options.html).
+
-## scrollBehavior
+> このオプションは [vue-router の Router コンストラクタ](https://router.vuejs.org/en/api/options.html) に直接付与されます。
-- Type: `Function`
+## scrollBehavior
-The `scrollBehavior` option lets you define a custom behavior for the scroll position between the routes. This method is called every time a page is rendered.
+
+
+- タイプ: `関数`
+
+
+
+`scrollBehavior` オプションを使って、ページ間のスクロール位置についての独自の振る舞いを定義できます。このメソッドはページがレンダリングされるたびに毎回呼び出されます。
+
+
+
+デフォルトでは scrollBehavior オプションは次のようにセットされています:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-By default, the scrollBehavior option is set to:
```js
const scrollBehavior = (to, from, savedPosition) => {
- // savedPosition is only available for popstate navigations.
+ // savedPosition は popState ナビゲーションでのみ利用できます
if (savedPosition) {
return savedPosition
} else {
let position = {}
- // if no children detected
+ // 子パスが見つからないとき
if (to.matched.length < 2) {
- // scroll to the top of the page
+ // ページのトップへスクロールする
position = { x: 0, y: 0 }
}
else if (to.matched.some((r) => r.components.default.options.scrollToTop)) {
- // if one of the children has scrollToTop option set to true
+ // 子パスのひとつが scrollToTop オプションが true にセットされているとき
position = { x: 0, y: 0 }
}
- // if link has anchor, scroll to anchor by returning the selector
+ // アンカーがあるときは、セレクタを返すことでアンカーまでスクロールする
if (to.hash) {
position = { selector: to.hash }
}
@@ -77,9 +138,12 @@ const scrollBehavior = (to, from, savedPosition) => {
}
```
-Example of forcing the scroll position to the top for every routes:
+
+
+すべてのルートにおいて強制的にトップまでスクロールさせる例:
`nuxt.config.js`
+
```js
module.exports = {
router: {
@@ -90,46 +154,83 @@ module.exports = {
}
```
-> This option is given directly to the vue-router [Router constructor](https://router.vuejs.org/en/api/options.html).
+
+
+> このオプションは vue-router の [Router コンストラクタ](https://router.vuejs.org/en/api/options.html) に直接付与されます。
## middleware
-- Type: `String` or `Array`
- - Items: `String`
+
+
+
+- タイプ: `文字列` または `配列`
+ - 要素: `文字列`
+
+
-Set the default(s) middleware for every pages of the application.
-Example:
+アプリケーションのすべてのページに対してデフォルトのミドルウェアをセットします。
+
+
+
+例:
`nuxt.config.js`
+
+
+
+
+
+
+
+
+
+
```js
module.exports = {
router: {
- // Run the middleware/user-agent.js on every pages
+ // すべてのページで middleware/user-agent.js を実行します
middleware: 'user-agent'
}
}
```
`middleware/user-agent.js`
+
+
+
+
+
+
+
+
```js
export default function (context) {
- // Add the userAgent property in the context (available in `data` and `fetch`)
+ // userAgent プロパティを context 内に追加します(context は `data` メソッドや `fetch` メソッド内で利用できます)
context.userAgent = context.isServer ? context.req.headers['user-agent'] : navigator.userAgent
}
```
-To learn more about the middleware, see the [middleware guide](/guide/routing#middleware).
+
+
+ミドルウェアについてより深く理解するには [middleware guide](/guide/routing#middleware) ガイドを参照してください。
## extendRoutes
-- Type: `Function`
+
+
+- タイプ: `関数`
-You may want to extend the routes created by nuxt.js. You can do it via the `extendRoutes` option.
+
-Example of adding a custom route:
+Nuxt.js によって作成されるルーティングを拡張したいことがあるかもしれません。それは `extendRoutes` オプションで実現できます。
+
+
+
+独自のルートを追加する例:
`nuxt.config.js`
+
```js
const resolve = require('path').resolve
@@ -146,4 +247,6 @@ module.exports = {
}
```
-The schema of the route should respect the [vue-router](https://router.vuejs.org/en/) schema.
+
+
+ルートのスキーマは [vue-router](https://router.vuejs.org/en/) のスキーマを尊重すべきです。
From 62e3fbec58388fd25a0ddfbbb54638de98117e03 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 2 Mar 2017 21:08:42 +0900
Subject: [PATCH 088/129] Make ja/api/configuration-router.md natural
---
ja/api/configuration-router.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ja/api/configuration-router.md b/ja/api/configuration-router.md
index 5731a35c1..342b501b4 100644
--- a/ja/api/configuration-router.md
+++ b/ja/api/configuration-router.md
@@ -1,6 +1,6 @@
---
title: "API: router プロパティ"
-description: router プロパティを使って Nuxt.js のルーター機能をカスタマイズできます。
+description: router プロパティを使って Nuxt.js のルーターをカスタマイズできます。
---
@@ -12,7 +12,7 @@ description: router プロパティを使って Nuxt.js のルーター機能を
-> router プロパティを使って Nuxt.js のルーター機能([vue-router](https://router.vuejs.org/en/))をカスタマイズできます。
+> router プロパティを使って Nuxt.js のルーター([vue-router](https://router.vuejs.org/en/))をカスタマイズできます。
## base
From 1541d36407856ccae2e0ba287768d85308e8ed81 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 2 Mar 2017 23:20:07 +0900
Subject: [PATCH 089/129] Translate ja/api/nuxt.md
---
ja/api/nuxt.md | 46 +++++++++++++++++++++++++++++++++++++---------
1 file changed, 37 insertions(+), 9 deletions(-)
diff --git a/ja/api/nuxt.md b/ja/api/nuxt.md
index 4ff4de310..83eb579f5 100644
--- a/ja/api/nuxt.md
+++ b/ja/api/nuxt.md
@@ -1,21 +1,45 @@
---
title: "API: Nuxt(options)"
-description: You can use nuxt.js programmatically to use it as a middleware giving you the freedom of creating your own server for rendering your web applications.
+description: Nuxt.js をプログラムで使って、Nuxt.js をウェブアプリケーションをレンダリングする独自サーバーをつくる自由を与えるミドルウェアとして使うことができます。
---
-# Using Nuxt.js Programmatically
+
+
-You might want to use your own server with your middleware and your API. That's why you can use Nuxt.js programmatically.
-Nuxt.js is built on the top of ES2015, which makes the code more enjoyable and cleaner to read. It doesn't make use of any transpilers and depends upon Core V8 implemented features. For these reasons, Nuxt.js targets Node.js `4.0` or higher.
+
+
+# Nuxt.js をプログラムで使う
+
+
+
+ミドルウェアや API と一緒に独自サーバーを使いたいときがあるかもしれません。それが Nuxt.js をプログラムで使うことができる理由です。
+
+
+Nuxt.js はコードをより楽しいものし、より読みやすくする ES2015 以上でビルドされます。トランスパイラを利用せず、また V8 エンジンで実装された機能に依存しません。このような理由から Nuxt.js は Node.js `4.0` 以上をターゲットにしています。
+
+
+
+Nuxt.js をこのように require できます:
-You can require Nuxt.js like this:
```js
const Nuxt = require('nuxt')
```
## Nuxt(options)
-To see the list of options to give to Nuxt.js, see the configuration section.
+
+
+Nuxt.js に与えられるオプション一覧を見るには、設定のセクションを参照してください。
+
+
+
+
+
+
+
+
+
+
```js
const options = {}
@@ -23,15 +47,19 @@ const options = {}
const nuxt = new Nuxt(options)
nuxt.build()
.then(() => {
- // We can use nuxt.render(req, res) or nuxt.renderRoute(route, context)
+ // nuxt.render(req, res) あるいは nuxt.renderRoute(route, context) を使うことができます
})
```
-You can take a look at the [nuxt-express](https://github.com/nuxt/express) and [adonuxt](https://github.com/nuxt/adonuxt) starters to start quickly.
+
+
+手早く始めるために [nuxt-express](https://github.com/nuxt/express) や [adonuxt](https://github.com/nuxt/adonuxt) スターターを見ることができます。
### Debug logs
-If you want to display nuxt.js logs, you can add to the top of your file:
+
+
+Nuxt.js のログを表示したいときはファイルのトップに下記を追加してください:
```js
process.env.DEBUG = 'nuxt:*'
From 83874d387fc942f2b2c68341fa10f2d62c3dda4f Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 2 Mar 2017 23:29:02 +0900
Subject: [PATCH 090/129] Make ja/api/nuxt.md natural
---
ja/api/nuxt.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ja/api/nuxt.md b/ja/api/nuxt.md
index 83eb579f5..052c649bb 100644
--- a/ja/api/nuxt.md
+++ b/ja/api/nuxt.md
@@ -1,6 +1,6 @@
---
title: "API: Nuxt(options)"
-description: Nuxt.js をプログラムで使って、Nuxt.js をウェブアプリケーションをレンダリングする独自サーバーをつくる自由を与えるミドルウェアとして使うことができます。
+description: Nuxt.js はプログラム上で、ミドルウェアとして使うことができます。そうすることでウェブアプリケーションをレンダリングする独自のサーバーを自由に作ることができます。
---
@@ -12,7 +12,7 @@ description: Nuxt.js をプログラムで使って、Nuxt.js をウェブアプ
-ミドルウェアや API と一緒に独自サーバーを使いたいときがあるかもしれません。それが Nuxt.js をプログラムで使うことができる理由です。
+ミドルウェアや API と合わせて独自サーバーを使いたいときがあるかもしれません。そのため、Nuxt.js はプログラムで使うことができるようにしています。
Nuxt.js はコードをより楽しいものし、より読みやすくする ES2015 以上でビルドされます。トランスパイラを利用せず、また V8 エンジンで実装された機能に依存しません。このような理由から Nuxt.js は Node.js `4.0` 以上をターゲットにしています。
@@ -29,7 +29,7 @@ const Nuxt = require('nuxt')
-Nuxt.js に与えられるオプション一覧を見るには、設定のセクションを参照してください。
+Nuxt.js に渡すことができるオプション一覧を見るには、設定のセクションを参照してください。
@@ -53,13 +53,13 @@ nuxt.build()
-手早く始めるために [nuxt-express](https://github.com/nuxt/express) や [adonuxt](https://github.com/nuxt/adonuxt) スターターを見ることができます。
+手っ取り早く始めるために [nuxt-express](https://github.com/nuxt/express) や [adonuxt](https://github.com/nuxt/adonuxt) スターターを参照できます。
### Debug logs
-Nuxt.js のログを表示したいときはファイルのトップに下記を追加してください:
+Nuxt.js のログを表示したいときはファイルのトップに次のコードを追加してください:
```js
process.env.DEBUG = 'nuxt:*'
From d4d195d6815db4237f90aabdd191517a9641af0f Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 3 Mar 2017 19:27:43 +0900
Subject: [PATCH 091/129] Translate ja/api/nuxt-render.md
---
ja/api/nuxt-render.md | 70 +++++++++++++++++++++++++++++++++++--------
1 file changed, 57 insertions(+), 13 deletions(-)
diff --git a/ja/api/nuxt-render.md b/ja/api/nuxt-render.md
index a3ee5e8eb..c334d3e44 100644
--- a/ja/api/nuxt-render.md
+++ b/ja/api/nuxt-render.md
@@ -1,34 +1,76 @@
---
title: "API: nuxt.render(req, res)"
-description: You can use Nuxt.js as a middleware for your node.js server.
+description: Nuxt.js を独自の Node.js サーバーのミドルウェアとして使うことができます。
---
+
+
+
# nuxt.render(req, res)
-- Type: `Function`
-- Arguments:
- 1. [Request](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
- 2. [Response](https://nodejs.org/api/http.html#http_class_http_serverresponse)
-- Returns: `Promise`
+
+
+
+
+
+
+- タイプ: `関数`
+- 引数:
+ 1. [リクエスト](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
+ 2. [レスポンス](https://nodejs.org/api/http.html#http_class_http_serverresponse)
+- 戻り値: `プロミス`
+
+
+
+> `nuxt.render` を使うと Nuxt.js を独自の Node.js サーバーのミドルウェアとして使うことができます。
+
+
+
+[Express.js](https://github.com/expressjs/express) と一緒に使う例:
-> You can use nuxt.js as a middleware with `nuxt.render` for your node.js server.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-Example with [Express.js](https://github.com/expressjs/express):
```js
const Nuxt = require('nuxt')
const app = require('express')()
const isProd = (process.env.NODE_ENV === 'production')
const port = process.env.PORT || 3000
-// We instantiate buxt.js with the options
+// Nuxt.js をオプションとともにインスタンス化
let config = require('./nuxt.config.js')
config.dev = !isProd
const nuxt = new Nuxt(config)
-// Render every route with nuxt.js
+// すべてのルートを Nuxt.js でレンダリングする
app.use(nuxt.render)
-// Build only in dev mode with hot-reloading
+// ホットリローディングする開発モードのときのみビルドする
if (config.dev) {
nuxt.build()
.catch((error) => {
@@ -37,9 +79,11 @@ if (config.dev) {
})
}
-// Listen the server
+// サーバーを Listen する
app.listen(port, '0.0.0.0')
console.log('Server listening on localhost:' + port)
```
-
It's recommended to call **nuxt.render** at the end of your middlewares since it will handle the rendering of your web application and won't call next()
+
+
+
+例:
+
+
+
+
+
+
-> Render a specific route with a given context.
+
+
+
+
+
+
-This method should be used mostly for [test purposes](guide/development-tools#end-to-end-testing) as well with [nuxt.renderAndGetWindow](/api/nuxt-render-and-get-window).
+
+
-
`nuxt.renderRoute` should be executed after the build process in production mode (dev: false).
+
+
+
+
-Example:
```js
const Nuxt = require('nuxt')
let config = require('./nuxt.config.js')
@@ -32,12 +74,12 @@ nuxt.build()
return nuxt.renderRoute('/')
})
.then(({ html, error, redirected }) => {
- // html will be always a string
+ // html は常に文字列
- // error not null when the error layout is displayed, the error format is:
- // { statusCode: 500, message: 'My error message' }
+ // エラーレイアウトが表示されるときは error は null ではありません。エラーフォーマットは下記:
+ // { statusCode: 500, message: 'エラーメッセージ' }
- // redirect is not false when redirect() has been used in data() or fetch()
+ // data() や fetch() で redirect() が使われたときは redirected は false ではありません
// { path: '/other-path', query: {}, status: 302 }
})
```
From 57362625fe98debb8b00c888676214c1d38485ab Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Fri, 3 Mar 2017 20:57:21 +0900
Subject: [PATCH 093/129] Translate ja/api/nuxt-render-and-get-window.md
---
ja/api/nuxt-render-and-get-window.md | 58 +++++++++++++++++++++-------
1 file changed, 45 insertions(+), 13 deletions(-)
diff --git a/ja/api/nuxt-render-and-get-window.md b/ja/api/nuxt-render-and-get-window.md
index b8c4368f9..50f7c4c45 100644
--- a/ja/api/nuxt-render-and-get-window.md
+++ b/ja/api/nuxt-render-and-get-window.md
@@ -1,35 +1,67 @@
---
title: "API: nuxt.renderAndGetWindow(url, options)"
-description: Get the window from a given url of a nuxt.js application.
+description: 与えられた Nuxt.js アプリケーションの URL から window を取得します。
---
+
+
+
# nuxt.renderAndGetWindow(url, options = {})
-- Type: `Function`
-- Argument: `String`
- 1. `String`: url to render
- 2. *Optional*, `Object`: options
- - virtualConsole: `Boolean` (default: `true`)
-- Returns: `Promise`
- - Returns: `window`
+
+
+
+
+
+
+
+
+- タイプ: `関数`
+- 引数: `文字列`
+ 1. `文字列`: レンダリングする URL
+ 2. *オプション*, `オブジェクト`: オプション
+ - virtualConsole: `ブーリアン`(デフォルト: `true`)
+- 戻り値: `Promise`
+ - 戻り値: `window`
+
+
+
+> 与えられた Nuxt.js アプリケーションの URL から window を取得します。
+
+
-> Get the window from a given url of a nuxt.js application.
+
From 5938e0c3cc86c4193fc6feccc6c52ee2b8b083ec Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 8 Mar 2017 00:49:51 +0900
Subject: [PATCH 109/129] Format indent of code
---
ja/faq/host-port.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ja/faq/host-port.md b/ja/faq/host-port.md
index efe807e98..efc8538cc 100644
--- a/ja/faq/host-port.md
+++ b/ja/faq/host-port.md
@@ -20,7 +20,7 @@ description: Nuxt.js でホストとポート番号を変更するには?
```js
"scripts": {
- "dev": "HOST=0.0.0.0 PORT=3333 nuxt"
+ "dev": "HOST=0.0.0.0 PORT=3333 nuxt"
}
```
@@ -30,12 +30,12 @@ description: Nuxt.js でホストとポート番号を変更するには?
```js
"config": {
- "nuxt": {
- "host": "0.0.0.0",
- "port": "3333"
- }
+ "nuxt": {
+ "host": "0.0.0.0",
+ "port": "3333"
+ }
},
"scripts": {
- "dev": "nuxt"
+ "dev": "nuxt"
}
```
From d328cc5419a03a0e96d8e381846fc3c84c67b371 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 8 Mar 2017 19:57:03 +0900
Subject: [PATCH 110/129] Translate ja/faq/window-document-undefined.md
---
ja/faq/window-document-undefined.md | 30 ++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/ja/faq/window-document-undefined.md b/ja/faq/window-document-undefined.md
index 3a405280c..e7d4c7d63 100644
--- a/ja/faq/window-document-undefined.md
+++ b/ja/faq/window-document-undefined.md
@@ -1,21 +1,37 @@
---
-title: Window or Document undefined
-description: Window or Document undefined with Nuxt.js?
+title: Window または Document が undefined
+description: Nuxt.js で Window または Document が undefined のときは?
---
-# Window or Document undefined?
+
+
-This is due to the server-side rendering.
-If you need to specify that you want to import a resource only on the client-side, you need to use the `process.BROWSER_BUILD` variable.
+
+
+# Window または Document が undefined のときは?
+
+
+
+このエラーはサーバーサイドレンダリングに起因しています。
+
+
+
+あるリソースをクライアントサイドでのみインポートしたいときは `process.BROWSER_BUILD` 変数を使う必要があります。
+
+
+
+例えば .vue ファイルに次のように書きます:
-For example, in your .vue file:
```js
if (process.BROWSER_BUILD) {
require('external_library')
}
```
-Don't forget to add your library in the [vendor bundle](/api/configuration-build#build-vendor) in your `nuxt.config.js`:
+
+
+`nuxt.config.js` ファイル内で当該ライブラリを [vendor bundle](/api/configuration-build#build-vendor) に加えておくのを忘れないでください。
+
```js
build: {
vendor: ['external_library']
From df4f899c8f96cc03d56a2fd492905f43fd711b28 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 8 Mar 2017 20:10:25 +0900
Subject: [PATCH 111/129] Translate ja/faq/css-flash.md
---
ja/faq/css-flash.md | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/ja/faq/css-flash.md b/ja/faq/css-flash.md
index 41a5ed34e..baaeda7e7 100644
--- a/ja/faq/css-flash.md
+++ b/ja/faq/css-flash.md
@@ -1,12 +1,21 @@
---
title: CSS Flash
-description: Why a CSS Flash appears with Nuxt.js?
+description: どうして Nuxt.js で CSS Flash が見えるのか?
---
-# Why a CSS Flash appears?
+
+
+
+
+
+# どうして CSS Flash が見えるのか?

-This is because the CSS is in the JavaScript build in **development mode** to allow hot-reloading via Webpack.
+
+
+これが見えるのは Webpack をとおしてホットリローディングする **開発モード** でビルドした JavaScript の中に CSS が埋め込まれているためです。
Don't worry in production mode, the CSS is separated and put in the header so this "flash" does not appear anymore.
+
+心配しないてください。プロダクションモードでは CSS は分離されて head に置かれるため、このような "flash" は見えません。
From eb4d26c2ab846d3861dfa1f21476a022142dd60f Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 8 Mar 2017 21:08:05 +0900
Subject: [PATCH 112/129] Translate ja/faq/async-data-components.md
---
ja/faq/async-data-components.md | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/ja/faq/async-data-components.md b/ja/faq/async-data-components.md
index b96e4e2f2..b4547be64 100644
--- a/ja/faq/async-data-components.md
+++ b/ja/faq/async-data-components.md
@@ -1,14 +1,29 @@
---
-title: Async data in components
-description: Async data in components?
+title: コンポーネント内の非同期データ
+description: コンポーネント内で非同期データを扱うには?
---
-# Async data in components?
+
+
-It is not possible because it's not linked to a route, Nuxt.js surcharges the component data() associated to a route to allow async data.
+
-For sub components, there are 2 ways of achieving it:
-1. Making the API call in the mounted() hook and setting the data afterwards, downside: no server rendering
-2. Making the API call in the data() of the page component and giving the data as a prop to the subComponent: server rendering OK. But the data() of the page might be less readable because it's loading the async data of the sub components
+# コンポーネント内で非同期データを扱うには?
-It all depends if you want the sub components to be server-rendered or not.
+
+
+コンポーネントはルートに関連付けられていないため(訳注: 基本的には)非同期データを扱うことはできません。Nuxt.js ではルートに関連付けられたコンポーネントの data() メソッドに手を加えて非同期データを扱えるようにしています。
+
+
+
+しかしながら、サブコンポーネントでも非同期データを扱えるようにする方法が 2つあります:
+
+
+
+
+1. mounted() フック内に API コールを作成し、その呼び出し以降にデータをセットすること。マイナスな側面としては、サーバーサイドレンダリングできなくなります。
+2. ページコンポーネントの data() メソッド内に API コールを作成し、データをプロパティとしてサブコンポーネントに渡すこと。この方法ではサーバーサイドレンダリングできます。しかしページの data() メソッドがサブコンポーネントの非同期データをロードするため、可読性が落ちるかもしれません。
+
+
+
+どちらを選ぶべきかは、サブコンポーネントをサーバーサイドレンダリングしたいか否かにかかっています。
From bdad48e41b8fa3561f1e70a3036d8042ad02bd5e Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Wed, 8 Mar 2017 21:31:25 +0900
Subject: [PATCH 113/129] Translate ja/faq/duplicated-meta-tags.md
---
ja/faq/duplicated-meta-tags.md | 37 +++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/ja/faq/duplicated-meta-tags.md b/ja/faq/duplicated-meta-tags.md
index 235a51f11..75fc76244 100644
--- a/ja/faq/duplicated-meta-tags.md
+++ b/ja/faq/duplicated-meta-tags.md
@@ -1,17 +1,31 @@
---
-title: Duplicated Meta tags
-description: Duplicated Meta tags with Nuxt.js?
+title: 重複したメタタグ
+description: Nuxt.js でメタタグが重複したときは?
---
-# Duplicated Meta tags?
+
+
-This is a "feature" of [vue-meta](https://github.com/declandewet/vue-meta), please take a look at the [documentation of head elements](https://nuxtjs.org/guide/html-head#defaults-meta).
+
-> To avoid any duplication when used in child component, please give a unique identifier with the hid key, please [read more](https://github.com/declandewet/vue-meta#lists-of-tags) about it.
+# メタタグが重複したときは?
-For the meta description, you need to add the unique identifier `hid` so vue-meta will know that it has to overwrite the default tag.
+
+
+これは [vue-meta](https://github.com/declandewet/vue-meta) の "特徴" です。[head 要素のドキュメント](https://nuxtjs.org/guide/html-head#defaults-meta) を参照してください。
+
+
+
+コンポーネントで vue-meta が使われたときに重複を避けるためには、ユニーク識別子を hid キーで付与してください。詳細は [こちら](https://github.com/declandewet/vue-meta#lists-of-tags) を参照してください。
+
+
+
+例えば description のメタタグについて、`hid` ユニーク識別子を付与する必要があります。そうすれば vue-meta は、デフォルトのタグを上書きすべきということを知ることができます。
+
+
+
+`nuxt.config.js`:
-Your `nuxt.config.js`:
```js
...head: {
title: 'starter',
@@ -25,7 +39,10 @@ Your `nuxt.config.js`:
...
```
-An then in your individual page:
+
+
+それから個別ページには次のように記述します:
+
```js
export default {
head () {
@@ -39,4 +56,6 @@ export default {
}
```
-To learn how to use the `head` property in your pages, please see the [HTML head documentation](/guide/views/#html-head).
+
+
+ページ内の `head` プロパティの使い方をより深く理解するには [HTML の head 情報のドキュメント](/guide/views/#html-head) を参照してください。
From 9b39d96af7a186509f1f705bbcf6d97e91df46ff Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 9 Mar 2017 21:16:06 +0900
Subject: [PATCH 114/129] Translate ja/faq/heroku-deployment.md
---
ja/faq/heroku-deployment.md | 45 ++++++++++++++++++++++++++++---------
1 file changed, 34 insertions(+), 11 deletions(-)
diff --git a/ja/faq/heroku-deployment.md b/ja/faq/heroku-deployment.md
index d077f027f..409891c36 100644
--- a/ja/faq/heroku-deployment.md
+++ b/ja/faq/heroku-deployment.md
@@ -1,28 +1,46 @@
---
-title: Heroku Deployment
-description: How to deploy Nuxt.js on Heroku?
+title: Heroku へデプロイ
+description: Heroku へデプロイするには?
---
-# How to deploy on Heroku?
+
+
-We recommend you to read the [Heroku documentation for node.js](https://devcenter.heroku.com/articles/nodejs-support).
+
+
+# Heroku へデプロイするには?
+
+
+
+[Node.js 用の Heroku ドキュメント](https://devcenter.heroku.com/articles/nodejs-support) を読むことをお勧めします。
+
+
+
+まず `npm run build` を実行できるようにするために、 Heroku にプロジェクトの `devDependencies` をインストールすることを伝える必要があります:
-First, we need to tell Heroku to install the `devDependencies` of the project (to be able to launch `npm run build`):
```bash
heroku config:set NPM_CONFIG_PRODUCTION=false
```
-Also, we want our application to listen on the port `0.0.0.0` and run in production mode:
+
+
+またアプリケーションに `0.0.0.0` ポートを Listen させ、プロダクションモードで起動します:
+
```bash
heroku config:set HOST=0.0.0.0
heroku config:set NODE_ENV=production
```
-You should see this in your Heroku dashboard (Settings section):
+
-
+Heroku ダッシュボードの Settings セクションで確認すべきです。
+
+ 
+
+
+
+それから `package.json` 内の `heroku-postbuild` スクリプト経由で Heroku に `npm run build` を実行するよう伝えます:
-Then, we tell Heroku to launch `npm run build` via the `heroku-postbuild` script in our `package.json`:
```js
"scripts": {
"dev": "nuxt",
@@ -32,9 +50,14 @@ Then, we tell Heroku to launch `npm run build` via the `heroku-postbuild` script
}
```
-Finally, we can push the app on Heroku with:
+
+
+最後にアプリケーションを Heroku に git push します:
+
```bash
git push heroku master
```
-Voilà! Your nuxt.js application is now hosted on Heroku!
+
+
+やりました!これで Nuxt.js アプリケーションは Heroku でホストされるようになりました!
From 17532a97c36042f1473647cf5192401f6ffd309c Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 9 Mar 2017 21:19:01 +0900
Subject: [PATCH 115/129] Make ja/faq/heroku-deployment.md natural
---
ja/faq/heroku-deployment.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ja/faq/heroku-deployment.md b/ja/faq/heroku-deployment.md
index 409891c36..75e07720c 100644
--- a/ja/faq/heroku-deployment.md
+++ b/ja/faq/heroku-deployment.md
@@ -12,11 +12,11 @@ description: Heroku へデプロイするには?
-[Node.js 用の Heroku ドキュメント](https://devcenter.heroku.com/articles/nodejs-support) を読むことをお勧めします。
+[Node.js 用の Heroku ドキュメント](https://devcenter.heroku.com/articles/nodejs-support) をお読みになることをお勧めします。
-まず `npm run build` を実行できるようにするために、 Heroku にプロジェクトの `devDependencies` をインストールすることを伝える必要があります:
+まず `npm run build` を実行できるようにするために、Heroku にプロジェクトの `devDependencies` をインストールすることを伝える必要があります:
```bash
heroku config:set NPM_CONFIG_PRODUCTION=false
@@ -33,13 +33,13 @@ heroku config:set NODE_ENV=production
-Heroku ダッシュボードの Settings セクションで確認すべきです。
+下記は Heroku ダッシュボードの Settings セクションに表示されています:

-それから `package.json` 内の `heroku-postbuild` スクリプト経由で Heroku に `npm run build` を実行するよう伝えます:
+それから `package.json` 内の `heroku-postbuild` スクリプトを使って、Heroku に `npm run build` を実行するよう伝えます:
```js
"scripts": {
From b35feee8436b14e79c2f42ef99322b7768001de8 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 9 Mar 2017 21:23:00 +0900
Subject: [PATCH 116/129] Translate ja/faq/now-deployment.md
---
ja/faq/now-deployment.md | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/ja/faq/now-deployment.md b/ja/faq/now-deployment.md
index e796d437d..db41cf3ca 100644
--- a/ja/faq/now-deployment.md
+++ b/ja/faq/now-deployment.md
@@ -1,11 +1,19 @@
---
-title: Now Deployment
-description: How to deploy Nuxt.js with Now.sh?
+title: Now を使ったデプロイ
+description: Now を使ってデプロイするには?
---
-# How to deploy with Now.sh?
+
+
+
+
+
+# Now を使ってデプロイするには?
+
+
+
+[now.sh](https://zeit.co/now) を使ってデプロイするには `package.json` を次のように記述することが推奨されます:
-To deploy with [now.sh](https://zeit.co/now) a `package.json` like follows is recommended:
```json
{
"name": "my-app",
@@ -20,6 +28,10 @@ To deploy with [now.sh](https://zeit.co/now) a `package.json` like follows is re
}
```
-Then run `now` and enjoy!
+
+
+これで `now` を実行できます!エンジョイ!
+
+
-Note: we recommend putting `.nuxt` in `.npmignore` or `.gitignore`.
+メモ: `.nuxt` を `.npmignore` または `.gitignore` に入れておくことをお勧めします。
From ba87ec4d2d8bbaf6a9399fcd763ba6c7a2fe71e8 Mon Sep 17 00:00:00 2001
From: INOUE Takuya
Date: Thu, 9 Mar 2017 21:42:10 +0900
Subject: [PATCH 117/129] Translate ja/faq/surge-deployment.md
---
ja/faq/surge-deployment.md | 44 ++++++++++++++++++++++++++++----------
1 file changed, 33 insertions(+), 11 deletions(-)
diff --git a/ja/faq/surge-deployment.md b/ja/faq/surge-deployment.md
index 7af82dec5..7675dcab7 100644
--- a/ja/faq/surge-deployment.md
+++ b/ja/faq/surge-deployment.md
@@ -1,33 +1,55 @@
---
-title: Surge Deployment
-description: How to deploy Nuxt.js with Surge.sh?
+title: Surge へデプロイ
+description: Surge.sh へデプロイするには?
---
-# How to deploy with Surge.sh?
+
+
-Nuxt.js gives you the possibility to host your web application on any static hosting like [surge.sh](https://surge.sh/) for example.
+
+
+# Surge.sh へデプロイするには?
+
+
+
+Nuxt.js を使うと、例えば [surge.sh](https://surge.sh/) のような静的ホスティングサービスで、ウェブアプリケーションをホストすることが可能です。
+
+
+
+surge.sh へデプロイするには、まず surge をインストールします:
-To deploy on surge.sh, first install it on your computer:
```bash
npm install -g surge
```
-Then, we tell nuxt.js to generate our web application:
+
+
+それから Nuxt.js にウェブアプリケーションを生成させます:
```bash
npm run generate
```
-It will create a `dist` folder with everything inside ready to be deployed on a static hosting.
+
-We can then deploy it to surge.sh:
+`dist` フォルダが作成され、その中に静的ホスティングサービスへデプロイされるものがすべて入ります。
+
+
+
+surge.sh へデプロイできます:
```bash
surge dist/
```
-Done :)
+
+
+これで完了です。:)
+
+
+
+プロジェクトが [動的なルーティング](/guide/routing#dynamic-routes) をしているなら、Nuxt.js に動的なルーティングを生成する方法を伝えるために [生成設定](/api/configuration-generate) を参照してください。
-If you have a project with [dynamic routes](/guide/routing#dynamic-routes), take a look at the [generate configuration](/api/configuration-generate) to tell nuxt.js how to generate these dynamic routes.
+
-
When generating your web application with `nuxt generate`, [the context](/api) given to [data()](/guide/async-data#the-data-method) and [fetch()](/guide/vuex-store#the-fetch-method) will not have `req` and `res`.