You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
470 B

import en from './en.js'//英语语言包
import es from './es.js'//西班牙语言包
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
const lang = uni.getStorageSync('language') || 'en';//获取缓存中的语言
// const lang = 'en';
// VueI18n构造函数所需要的配置
const i18nConfig = {
locale: lang,//当前语言
// 所需要用的语言包
messages:{
en,
es
}
}
const i18n = new VueI18n(i18nConfig)
export default i18n