|
@@ -1,15 +1,11 @@
|
|
|
import Vue from 'vue'
|
|
|
import VueI18n from 'vue-i18n'
|
|
|
+import jsFn from '@/utils/js-fn.js'
|
|
|
import tools from '@/utils/public.js'
|
|
|
import ElementLocale from 'element-ui/lib/locale'
|
|
|
ElementLocale.i18n((key, value) => i18n.t(key, value))
|
|
|
Vue.use(VueI18n)
|
|
|
-// 自动根据浏览器系统语言设置语言(优先判断本地设置的语言,如果有则使用本地设置的语言,如果没有则使用浏览器系统语言)
|
|
|
-const curLang = localStorage.getItem('cloudSetting') ? JSON.parse(localStorage.getItem('cloudSetting')).curLang : null
|
|
|
-const navLang = curLang || navigator.language.toLowerCase()
|
|
|
-const localLang = (navLang === 'zh' || navLang === 'zh-tw' || navLang === 'zh-cn' || navLang === 'zh-hk') ? navLang : false
|
|
|
-let lang = localLang || 'en-us'
|
|
|
-localStorage.setItem('local', lang)
|
|
|
+let lang = jsFn.setLocalLang()
|
|
|
Vue.config.lang = lang
|
|
|
Vue.locale = () => { }
|
|
|
const i18n = new VueI18n({
|