nuxt-i18n
Advanced tools
Comparing version 6.11.0 to 6.11.1
@@ -0,1 +1,8 @@ | ||
### [6.11.1](https://github.com/nuxt-community/nuxt-i18n/compare/v6.11.0...v6.11.1) (2020-05-10) | ||
### Bug Fixes | ||
* NavigationDuplicated error on loading 404 page in SPA ([#705](https://github.com/nuxt-community/nuxt-i18n/issues/705)) ([6bd80da](https://github.com/nuxt-community/nuxt-i18n/commit/6bd80da4ee21918abb551629720723dc82d69fc0)), closes [#702](https://github.com/nuxt-community/nuxt-i18n/issues/702) | ||
## [6.11.0](https://github.com/nuxt-community/nuxt-i18n/compare/v6.10.1...v6.11.0) (2020-04-30) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "nuxt-i18n", | ||
"version": "6.11.0", | ||
"version": "6.11.1", | ||
"description": "i18n for Nuxt", | ||
@@ -57,3 +57,4 @@ "license": "MIT", | ||
"release": true, | ||
"releaseName": "${version}" | ||
"releaseName": "${version}", | ||
"releaseNotes": "echo \"${changelog}\" | sed 1,2d" | ||
}, | ||
@@ -93,9 +94,9 @@ "plugins": { | ||
"devDependencies": { | ||
"@babel/core": "7.9.0", | ||
"@babel/preset-env": "7.9.5", | ||
"@babel/runtime": "7.9.2", | ||
"@nuxt/types": "0.7.4", | ||
"@babel/core": "7.9.6", | ||
"@babel/preset-env": "7.9.6", | ||
"@babel/runtime": "7.9.6", | ||
"@nuxt/types": "0.7.5", | ||
"@nuxtjs/eslint-config-typescript": "1.0.2", | ||
"@nuxtjs/module-test-utils": "1.6.1", | ||
"@release-it/conventional-changelog": "1.1.3", | ||
"@release-it/conventional-changelog": "1.1.4", | ||
"@types/jest": "25.2.1", | ||
@@ -107,10 +108,10 @@ "babel-core": "7.0.0-bridge.0", | ||
"core-js": "3.6.5", | ||
"eslint": "6.8.0", | ||
"eslint": "7.0.0", | ||
"geckodriver": "1.19.1", | ||
"jest": "25.4.0", | ||
"jest": "26.0.1", | ||
"jsdom": "16.2.2", | ||
"messageformat": "2.3.0", | ||
"nuxt": "2.12.2", | ||
"puppeteer-core": "3.0.1", | ||
"release-it": "13.5.5", | ||
"puppeteer-core": "3.0.4", | ||
"release-it": "13.5.8", | ||
"selenium-webdriver": "4.0.0-alpha.7", | ||
@@ -117,0 +118,0 @@ "tib": "0.7.4", |
@@ -88,3 +88,5 @@ import Vue from 'vue' | ||
const redirectPath = getRedirectPathForLocale(newLocale) | ||
// Must retrieve from context as it might have changed since plugin initialization. | ||
const { route } = context | ||
const redirectPath = getRedirectPathForLocale(route, newLocale) | ||
@@ -104,21 +106,20 @@ if (initialSetup) { | ||
const getRedirectPathForLocale = locale => { | ||
const getRedirectPathForLocale = (route, locale) => { | ||
if (!locale || app.i18n.differentDomains || strategy === STRATEGIES.NO_PREFIX) { | ||
return | ||
return '' | ||
} | ||
// Must retrieve from context as it might have changed since plugin initialization. | ||
const { route } = context | ||
const routeLocale = getLocaleFromRoute(route) | ||
if (routeLocale === locale) { | ||
return | ||
if (getLocaleFromRoute(route) === locale) { | ||
return '' | ||
} | ||
// At this point we are left with route that either no or different locale. | ||
// At this point we are left with route that either has no or different locale. | ||
let redirectPath = app.switchLocalePath(locale) | ||
if (!redirectPath) { | ||
// Could be a 404 route in which case we should attemp to find matching route for given locale. | ||
redirectPath = app.localePath(route.path, locale) | ||
// Current route could be 404 in which case attempt to find matching route for given locale. | ||
redirectPath = app.localePath(route.fullPath, locale) | ||
if (redirectPath === route.fullPath) { | ||
return '' | ||
} | ||
} | ||
@@ -125,0 +126,0 @@ |
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
94160
1346