提交 2b7c1ad1 编写于 作者: D DCloud_LXH

chore: config

上级 058600fb
......@@ -172,9 +172,9 @@ export const navbarLanguage = {
{
text: 'English',
link: 'https://en.uniapp.dcloud.io/',
click() {
/* click() {
localStorage.setItem(window.__UNI_DOCS_ZH_KEY__ || 'unidocs-zh-language', 'en')
}
} */
}
]
}
\ No newline at end of file
......@@ -6,32 +6,12 @@ var website_EN_host = 'en.uniapp.dcloud.io'
var website_ZH = 'https://' + website_ZH_host;
var website_EN = 'https://' + website_EN_host;
window.__UNI_DOCS_ZH_KEY__ = 'unidocs-zh-language'
// window.__UNI_DOCS_ZH_KEY__ = 'unidocs-zh-language'
if (host === 'uniapp.dcloud.io') {
var localStorageLanguage = localStorage.getItem(window.__UNI_DOCS_ZH_KEY__)
if (localStorageLanguage) {
switch (localStorageLanguage) {
case LOCAL_ZH:
if (host !== website_ZH_host) {
window.location.href = website_ZH + pathname;
}
break;
case LOCAL_EN:
if (host !== website_EN_host) {
window.location.href = website_EN + pathname;
}
break;
default:
break;
}
} else {
var website_finally =
navigator.language.indexOf('zh') !== -1
? website_ZH
: website_EN;
window.location.href = website_finally + pathname;
}
var website_finally =
navigator.language.indexOf('zh') !== -1
? website_ZH
: website_EN;
window.location.href = website_finally + pathname;
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册