nuxt-i18n
Advanced tools
Comparing version 5.12.1 to 5.12.2
@@ -5,2 +5,11 @@ # Change Log | ||
## [5.12.2](https://github.com/nuxt-community/nuxt-i18n/compare/v5.12.1...v5.12.2) (2019-05-09) | ||
### Bug Fixes | ||
* add missing vue-template-compiler dependency (fixes [#297](https://github.com/nuxt-community/nuxt-i18n/issues/297)) ([#298](https://github.com/nuxt-community/nuxt-i18n/issues/298)) ([196b4e0](https://github.com/nuxt-community/nuxt-i18n/commit/196b4e0)) | ||
## [5.12.1](https://github.com/nuxt-community/nuxt-i18n/compare/v5.12.0...v5.12.1) (2019-05-09) | ||
@@ -7,0 +16,0 @@ |
{ | ||
"name": "nuxt-i18n", | ||
"version": "5.12.1", | ||
"version": "5.12.2", | ||
"description": "i18n for Nuxt", | ||
@@ -51,3 +51,4 @@ "license": "MIT", | ||
"vue-i18n": "^8.11.2", | ||
"vue-i18n-extensions": "^0.2.1" | ||
"vue-i18n-extensions": "^0.2.1", | ||
"vue-template-compiler": "^2.6.10" | ||
}, | ||
@@ -54,0 +55,0 @@ "devDependencies": { |
@@ -134,13 +134,13 @@ /* global app, req, vuex, store */ | ||
* @param {Object} messages Current messages | ||
* @return {void} | ||
* @return {Promise(void)} | ||
*/ | ||
exports.syncVuex = (locale = null, messages = null) => { | ||
exports.syncVuex = async (locale = null, messages = null) => { | ||
if (vuex && store) { | ||
if (locale !== null && vuex.mutations.setLocale) { | ||
store.dispatch(vuex.moduleName + '/setLocale', locale) | ||
await store.dispatch(vuex.moduleName + '/setLocale', locale) | ||
} | ||
if (messages !== null && vuex.mutations.setMessages) { | ||
store.dispatch(vuex.moduleName + '/setMessages', messages) | ||
await store.dispatch(vuex.moduleName + '/setMessages', messages) | ||
} | ||
} | ||
} |
@@ -20,3 +20,2 @@ const { resolve, join } = require('path') | ||
const { makeRoutes } = require('./helpers/routes') | ||
const { | ||
@@ -64,2 +63,4 @@ getLocaleCodes, | ||
this.extendRoutes((routes) => { | ||
const { makeRoutes } = require('./helpers/routes') | ||
const localizedRoutes = makeRoutes(routes, { | ||
@@ -66,0 +67,0 @@ ...options, |
@@ -125,8 +125,8 @@ import Cookie from 'cookie' | ||
const messages = await loadLanguageAsync(context, app.i18n.locale) | ||
syncVuex(locale, messages) | ||
await syncVuex(locale, messages) | ||
return messages | ||
} else { | ||
// Sync Vuex | ||
syncVuex(locale, app.i18n.getLocaleMessage(locale)) | ||
await syncVuex(locale, app.i18n.getLocaleMessage(locale)) | ||
} | ||
} |
@@ -75,3 +75,3 @@ import Cookie from 'cookie' | ||
app.i18n.onLanguageSwitched(oldLocale, newLocale) | ||
syncVuex(newLocale, messages) | ||
await syncVuex(newLocale, messages) | ||
} else { | ||
@@ -81,3 +81,3 @@ // Lazy-loading disabled | ||
app.i18n.onLanguageSwitched(oldLocale, newLocale) | ||
syncVuex(newLocale, app.i18n.getLocaleMessage(newLocale)) | ||
await syncVuex(newLocale, app.i18n.getLocaleMessage(newLocale)) | ||
} | ||
@@ -84,0 +84,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
57331
8
+ Addedde-indent@1.0.2(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedvue-template-compiler@2.7.16(transitive)