Skip to content

Commit 0d081ee

Browse files
committed
Merge branch 'develop'
2 parents 00287e5 + cd10ba3 commit 0d081ee

File tree

6 files changed

+1688
-829
lines changed

6 files changed

+1688
-829
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="2.0.0"></a>
6+
# [2.0.0](https://github.com/paulgv/nuxt-i18n/compare/v1.0.2...v2.0.0) (2018-01-26)
7+
8+
9+
### Features
10+
11+
* Improved dynamic nested routes support ([e08935e](https://github.com/paulgv/nuxt-i18n/commit/e08935e))
12+
13+
### BREAKING CHANGES
14+
15+
* Custom routes translations now use routes `chunkName` instead of `name`, you should update your config accordlingly.
16+
517
<a name="1.1.0"></a>
618
# [1.1.0](https://github.com/paulgv/nuxt-i18n/compare/v1.0.2...v1.1.0) (2018-01-22)
719

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ module.exports = {
230230
category: {
231231
fr: '/categorie'
232232
},
233-
'category-slug': {
233+
'category/_slug': {
234234
fr: '/categorie/:slug'
235235
}
236236
},

lib/routes.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const generateRoutes = ({
3333

3434
localizedRoutes.forEach(baseRoute => {
3535
locales.forEach((locale) => {
36-
const { component } = baseRoute
36+
const { component, chunkName } = baseRoute
3737
let { path, name, children } = baseRoute
38+
const cleanChunkName = chunkName.replace(/^pages\//, '');
3839
if (children) {
3940
children = generateRoutes({
4041
baseRoutes: children,
@@ -46,8 +47,8 @@ const generateRoutes = ({
4647
})
4748
}
4849
const { code } = locale
49-
if (has(routesOptions, `${name}.${code}`)) {
50-
path = routesOptions[name][code]
50+
if (has(routesOptions, `${cleanChunkName}.${code}`)) {
51+
path = routesOptions[cleanChunkName][code]
5152
}
5253
// Don't change path when current route is a child
5354
if (code !== defaultLocale && !isChild) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-i18n",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "i18n for Nuxt",
55
"license": "MIT",
66
"contributors": [
@@ -38,6 +38,6 @@
3838
"vue-i18n-extensions": "^0.1.0"
3939
},
4040
"devDependencies": {
41-
"nuxt-module-builder": "latest"
41+
"nuxt-module-builder": "^1.0.0"
4242
}
4343
}

test/fixture/nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
fallbackLocale: 'en'
3636
},
3737
routes: {
38-
about: {
38+
'pages/about': {
3939
fr: '/a-propos',
4040
en: '/about-us'
4141
}

0 commit comments

Comments
 (0)