mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Fix example
This commit is contained in:
parent
f4c68e95e2
commit
9d43db475b
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nuxt-i18n",
|
||||
"dependencies": {
|
||||
"nuxt": "latest",
|
||||
"nuxt": "^1.0.0-rc9",
|
||||
"vue-i18n": "^7.0.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -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'),
|
||||
|
Loading…
Reference in New Issue
Block a user