mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Fix i18n example
This commit is contained in:
parent
1de4a16a02
commit
3cb603f922
@ -3,11 +3,11 @@ import VueI18n from 'vue-i18n'
|
|||||||
|
|
||||||
Vue.use(VueI18n)
|
Vue.use(VueI18n)
|
||||||
|
|
||||||
export default ({ app, isClient, store, serverStore }) => {
|
export default ({ app, isClient, store }) => {
|
||||||
// Set i18n instance on app
|
// Set i18n instance on app
|
||||||
// This way we can use it in middleware and pages asyncData/fetch
|
// This way we can use it in middleware and pages asyncData/fetch
|
||||||
app.i18n = new VueI18n({
|
app.i18n = new VueI18n({
|
||||||
locale: (isClient ? serverStore.locale : store.state.locale),
|
locale: store.state.locale,
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: 'en',
|
||||||
messages: {
|
messages: {
|
||||||
'en': require('~/locales/en.json'),
|
'en': require('~/locales/en.json'),
|
||||||
|
Loading…
Reference in New Issue
Block a user