22 lines
327 B
JavaScript
22 lines
327 B
JavaScript
|
|
import Vue from 'vue'
|
||
|
|
import VueI18n from 'vue-i18n'
|
||
|
|
import zh from './zh';
|
||
|
|
import en from './en';
|
||
|
|
Vue.use(VueI18n)
|
||
|
|
|
||
|
|
// load locale messages
|
||
|
|
const messages = {
|
||
|
|
zh,
|
||
|
|
en,
|
||
|
|
}
|
||
|
|
|
||
|
|
const locale = localStorage.getItem('locale') || 'zh'
|
||
|
|
|
||
|
|
const i18n = new VueI18n({
|
||
|
|
locale,
|
||
|
|
fallbackLocale: 'zh',
|
||
|
|
messages,
|
||
|
|
})
|
||
|
|
|
||
|
|
export default i18n
|