lang.js 317 B

123456789101112131415161718192021
  1. import Vue from 'vue'
  2. import VueI18n from 'vue-i18n'
  3. import en from './en'
  4. import zh from './zh'
  5. import { getLanguage } from '../util'
  6. Vue.use(VueI18n)
  7. let messages = {
  8. en,
  9. zh
  10. }
  11. let locale = localStorage.getItem('lang') || getLanguage()
  12. const i18n = new VueI18n({
  13. locale,
  14. messages
  15. })
  16. export default i18n