Skip to content

Commit

Permalink
docs: Add documentation for noPrefixDefaultLocale & redirectRootToLocale
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgv committed Jan 27, 2018
1 parent 65cacfd commit 51b1508
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ In the app, you'll need to preserve the language when generating URLs. To do thi

## Options

| Option | Type | Description |
|-----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `locales` | Array | A list of objects that describes the locales available in your app, each object should contain at least a `code` key |
| `defaultLocale` | String | The app's default locale, URLs for this language won't be prefixed with the locale code |
| `vueI18n` | Object | Configuration options for vue-i18n, refer to [the doc](http://kazupon.github.io/vue-i18n/en/api.html#constructor-options) for supported options |
| `routes` | Object | Custom routing configuration, if routes are omitted, Nuxt's default routes are used |
| `ignorePaths` | Array | A list of paths that should not be localized |

| Option | Type | Default | Description |
|-------------------------|---------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `locales` | Array | | A list of objects that describes the locales available in your app, each object should contain at least a `code` key |
| `defaultLocale` | String | | The app's default locale, URLs for this language won't be prefixed with the locale code |
| `vueI18n` | Object | | Configuration options for vue-i18n, refer to [the doc](http://kazupon.github.io/vue-i18n/en/api.html#constructor-options) for supported options |
| `routes` | Object | | Custom routing configuration, if routes are omitted, Nuxt's default routes are used |
| `ignorePaths` | Array | | A list of paths that should not be localized |
| `noPrefixDefaultLocale` | Boolean | `true` | By default, paths generated for the default language don't contain a locale prefix, set this option to `false` to disable this behavior |
| `redirectRootToLocale` | String | | Specify a locale to which the user should be redirected when visiting root URL (/), doesn't do anything if `noPrefixDefaultLocale` is enabled |

## Configuration example

Expand All @@ -207,6 +208,8 @@ module.exports = {
}
],
defaultLocale: 'en',
noPrefixDefaultLocale: true,
redirectRootToLocale: 'en',
vueI18n: {
messages: {
fr: {
Expand Down

0 comments on commit 51b1508

Please sign in to comment.