nuxt-i18n
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.2.1"></a> | ||
## [2.2.1](https://github.com/paulgv/nuxt-i18n/compare/v2.2.0...v2.2.1) (2018-02-10) | ||
### Bug Fixes | ||
* Cleaner URLs for index ([72938f3](https://github.com/paulgv/nuxt-i18n/commit/72938f3)) | ||
<a name="2.2.0"></a> | ||
@@ -7,0 +17,0 @@ # [2.2.0](https://github.com/paulgv/nuxt-i18n/compare/v2.1.1...v2.2.0) (2018-02-10) |
@@ -25,3 +25,2 @@ const { has } = require('lodash') | ||
const localizedRoutes = [] | ||
// Extract routes that should not be localized | ||
@@ -65,2 +64,5 @@ baseRoutes.forEach(route => { | ||
} | ||
if (cleanChunkName === 'index' && path !== '/' && path.match(/\/$/) !== null) { | ||
path = path.replace(/\/$/, '') | ||
} | ||
} | ||
@@ -67,0 +69,0 @@ const route = { path, component } |
@@ -20,3 +20,3 @@ import middleware from './middleware' | ||
locales.forEach(l => { | ||
const regexp = new RegExp('^/' + l.code + '/') | ||
const regexp = new RegExp('^/' + l.code + '(/.+)?') | ||
if (route.path.match(regexp)) { | ||
@@ -23,0 +23,0 @@ locale = l.code |
@@ -20,8 +20,2 @@ import './i18n.routing.middleware'; | ||
let { href } = resolved | ||
// Handle homepage exception | ||
if (route.name === 'index' && !href.match(/^\/\#.+/)) { | ||
href = route.hash | ||
? href.replace('#', '/#') | ||
: href + '/' | ||
} | ||
// Cleanup href | ||
@@ -28,0 +22,0 @@ href = (href.match(/^\/\/+$/)) ? '/' : href |
{ | ||
"name": "nuxt-i18n", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "i18n for Nuxt", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22424
250