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.

19 lines
470 B

8 months ago
  1. import en from './en.js'//英语语言包
  2. import es from './es.js'//西班牙语言包
  3. import Vue from 'vue'
  4. import VueI18n from 'vue-i18n'
  5. Vue.use(VueI18n)
  6. const lang = uni.getStorageSync('language') || 'en';//获取缓存中的语言
  7. // const lang = 'en';
  8. // VueI18n构造函数所需要的配置
  9. const i18nConfig = {
  10. locale: lang,//当前语言
  11. // 所需要用的语言包
  12. messages:{
  13. en,
  14. es
  15. }
  16. }
  17. const i18n = new VueI18n(i18nConfig)
  18. export default i18n