nuxt-i18n
Advanced tools
Comparing version 5.12.7 to 6.0.0-0
@@ -5,2 +5,30 @@ # Change Log | ||
# [6.0.0-0](https://github.com/nuxt-community/nuxt-i18n/compare/v5.12.8...v6.0.0-0) (2019-07-01) | ||
### Features | ||
* Dynamic route parameters translation ([04373ef](https://github.com/nuxt-community/nuxt-i18n/commit/04373ef)), closes [#79](https://github.com/nuxt-community/nuxt-i18n/issues/79) | ||
### BREAKING CHANGES | ||
* `preserveState` is now set automatically when registering the store module and | ||
cannot be set via the configuration anymore | ||
## [5.12.8](https://github.com/nuxt-community/nuxt-i18n/compare/v5.12.6...v5.12.8) (2019-07-01) | ||
> NOTE: Version bump only, all fixes were released in `v5.12.7` already | ||
### Bug Fixes | ||
* Move SEO types out of Vue module declaration ([be085d5](https://github.com/nuxt-community/nuxt-i18n/commit/be085d5)) | ||
* Move SEO types out of Vue module declaration ([#335](https://github.com/nuxt-community/nuxt-i18n/issues/335)) ([0cc0ba0](https://github.com/nuxt-community/nuxt-i18n/commit/0cc0ba0)) | ||
* Only require is-https dependency on the server (fixes [#329](https://github.com/nuxt-community/nuxt-i18n/issues/329)) ([8a728ef](https://github.com/nuxt-community/nuxt-i18n/commit/8a728ef)) | ||
* revert using cookies package to fix cookie headers handling ([#332](https://github.com/nuxt-community/nuxt-i18n/issues/332)) ([9cd034d](https://github.com/nuxt-community/nuxt-i18n/commit/9cd034d)), closes [#330](https://github.com/nuxt-community/nuxt-i18n/issues/330) | ||
## [5.12.7](https://github.com/nuxt-community/nuxt-i18n/compare/v5.12.6...v5.12.7) (2019-06-22) | ||
@@ -7,0 +35,0 @@ |
{ | ||
"name": "nuxt-i18n", | ||
"version": "5.12.7", | ||
"version": "6.0.0-0", | ||
"description": "i18n for Nuxt", | ||
@@ -58,10 +58,10 @@ "license": "MIT", | ||
"codecov": "3.5.0", | ||
"eslint": "5.16.0", | ||
"eslint": "6.0.1", | ||
"eslint-config-standard": "12.0.0", | ||
"eslint-plugin-import": "2.17.3", | ||
"eslint-plugin-import": "2.18.0", | ||
"eslint-plugin-jest": "22.7.1", | ||
"eslint-plugin-node": "9.1.0", | ||
"eslint-plugin-promise": "4.1.1", | ||
"eslint-plugin-promise": "4.2.1", | ||
"eslint-plugin-standard": "4.0.0", | ||
"eslint-plugin-vue": "5.2.2", | ||
"eslint-plugin-vue": "5.2.3", | ||
"jest": "24.8.0", | ||
@@ -72,4 +72,4 @@ "jsdom": "15.1.1", | ||
"typescript": "3.5.2", | ||
"vuepress": "1.0.1" | ||
"vuepress": "1.0.2" | ||
} | ||
} |
@@ -49,5 +49,5 @@ const packageJson = require('../../package.json') | ||
setLocale: 'I18N_SET_LOCALE', | ||
setMessages: 'I18N_SET_MESSAGES' | ||
}, | ||
preserveState: false | ||
setMessages: 'I18N_SET_MESSAGES', | ||
setRouteParams: 'I18N_SET_ROUTE_PARAMS' | ||
} | ||
}, | ||
@@ -54,0 +54,0 @@ parsePages: true, |
@@ -33,3 +33,4 @@ import Cookie from 'cookie' | ||
locale: '', | ||
messages: {} | ||
messages: {}, | ||
routeParams: {} | ||
}), | ||
@@ -42,2 +43,5 @@ actions: { | ||
commit(vuex.mutations.setMessages, messages) | ||
}, | ||
setRouteParams ({ commit }, params) { | ||
commit(vuex.mutations.setRouteParams, params) | ||
} | ||
@@ -51,5 +55,11 @@ }, | ||
state.messages = messages | ||
}, | ||
[vuex.mutations.setRouteParams] (state, params) { | ||
state.routeParams = params | ||
} | ||
}, | ||
getters: { | ||
localeRouteParams: ({ routeParams }) => locale => routeParams[locale] || {} | ||
} | ||
}, { preserveState: vuex.preserveState }) | ||
}, { preserveState: !!store.state[vuex.moduleName] }) | ||
} | ||
@@ -56,0 +66,0 @@ <% } %> |
import './middleware' | ||
import Vue from 'vue' | ||
const vuex = <%= JSON.stringify(options.vuex) %> | ||
const routesNameSeparator = '<%= options.routesNameSeparator %>' | ||
@@ -65,5 +66,15 @@ | ||
const { params, ...routeCopy } = this.$route | ||
let langSwitchParams = {} | ||
<% if (options.vuex) { %> | ||
if (this.$store) { | ||
langSwitchParams = this.$store.getters[`${vuex.moduleName}/localeRouteParams`](locale) | ||
} | ||
<% } %> | ||
const baseRoute = Object.assign({}, routeCopy, { | ||
name, | ||
params: { ...params, '0': params.pathMatch } | ||
params: { | ||
...params, | ||
...langSwitchParams, | ||
'0': params.pathMatch | ||
} | ||
}) | ||
@@ -70,0 +81,0 @@ let path = this.localePath(baseRoute, locale) |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
63082
1030
2