Fix example

This commit is contained in:
Sebastien Chopin 2017-09-01 17:38:16 +02:00
parent f4c68e95e2
commit 9d43db475b
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "nuxt-i18n",
"dependencies": {
"nuxt": "latest",
"nuxt": "^1.0.0-rc9",
"vue-i18n": "^7.0.5"
},
"scripts": {

View File

@ -3,11 +3,11 @@ import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
export default ({ app, store }) => {
export default ({ app, isClient, store, serverStore }) => {
// Set i18n instance on app
// This way we can use it in middleware and pages asyncData/fetch
app.i18n = new VueI18n({
locale: store.state.locale,
locale: (isClient ? serverStore.locale : store.state.locale),
fallbackLocale: 'en',
messages: {
'en': require('~/locales/en.json'),