mirror of https://github.com/ElemeFE/element
Homepage: fix a navigator.language bug (#1040)
parent
c08c6f1769
commit
4f835aa9af
|
@ -91,7 +91,7 @@ route.push({
|
||||||
component: require('./play/index.vue')
|
component: require('./play/index.vue')
|
||||||
});
|
});
|
||||||
|
|
||||||
let userLanguage = localStorage.getItem('ELEMENT_LANGUAGE') || window.navigator.language;
|
let userLanguage = localStorage.getItem('ELEMENT_LANGUAGE') || window.navigator.language || 'en-US';
|
||||||
let defaultPath = '/en-US';
|
let defaultPath = '/en-US';
|
||||||
if (userLanguage.indexOf('zh-') !== -1) {
|
if (userLanguage.indexOf('zh-') !== -1) {
|
||||||
defaultPath = '/zh-CN';
|
defaultPath = '/zh-CN';
|
||||||
|
|
Loading…
Reference in New Issue