Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-i18n

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-i18n - npm Package Compare versions

Comparing version 5.12.1 to 5.12.2

9

CHANGELOG.md

@@ -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 @@

5

package.json
{
"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": {

8

src/helpers/utils.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc