fixed language switch

This commit is contained in:
Grzegorz Leoniec 2018-12-18 10:20:22 +01:00
parent b546126583
commit deb62834b1
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ export default {
return
}
import(`~/locales/${locale}.json`).then(res => {
this.$i18n.add(locale, res)
this.$i18n.add(locale, res.default)
this.$i18n.set(locale)
})
},

View File

@ -63,7 +63,7 @@ export default ({ app, req, cookie, store }) => {
const locale = availableLocales.indexOf(userLocale) >= 0 ? userLocale : 'en'
if (locale !== 'en') {
Vue.i18n.add(locale, require(`~/locales/${locale}.json`))
Vue.i18n.add(locale, require(`~/locales/${locale}.json`).default)
}
// Set the start locale to use