11
This commit is contained in:
@@ -39,3 +39,30 @@ export function getParentNode(id) {
|
||||
}
|
||||
}
|
||||
|
||||
export function setAppLanguage(that){
|
||||
let lang = sessionStorage.getItem("lang");
|
||||
if (lang != null){
|
||||
that.$i18n.locale = lang
|
||||
return
|
||||
}
|
||||
var language = window.navigator.userLanguage || window.navigator.language;
|
||||
if (language == 'zh-CN'){
|
||||
lang = 'cn'
|
||||
}else {
|
||||
lang = 'en'
|
||||
}
|
||||
that.$i18n.locale = lang
|
||||
sessionStorage.setItem("lang",lang)
|
||||
}
|
||||
export function setLanguage(that){
|
||||
let lang = that.$route.query && that.$route.query.lang
|
||||
if (lang != undefined){
|
||||
that.$i18n.locale = lang
|
||||
sessionStorage.setItem("lang",lang)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user