Nuxt/examples/i18n/plugins/i18n.js

17 lines
301 B
JavaScript
Raw Normal View History

2017-02-08 17:49:16 +00:00
import Vue from 'vue'
2017-04-14 09:55:04 +00:00
import VueI18n from 'vue-i18n'
2017-02-08 17:49:16 +00:00
import store from '~store'
2017-04-14 09:55:04 +00:00
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: store.state.locale,
fallbackLocale: 'en',
messages: {
'en': require('~/locales/en.json'),
'fr': require('~/locales/fr.json')
}
})
export default i18n