mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
doc
This commit is contained in:
parent
eddc025ee1
commit
d996a8a467
28
docs/main.js
28
docs/main.js
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
homepage: '/redirect.html',
|
// homepage: '/redirect.html',
|
||||||
requestHeaders: {
|
requestHeaders: {
|
||||||
'cache-control': 'max-age=0',
|
'cache-control': 'max-age=0',
|
||||||
},
|
},
|
||||||
@ -79,18 +79,28 @@ const navitexts = {
|
|||||||
contactme: 'Chat Groups'
|
contactme: 'Chat Groups'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getcurrlang(url) {
|
||||||
|
for (let key in navitexts) {
|
||||||
|
if (url.includes(`/${key}/`)) {
|
||||||
|
return key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
window.onpopstate = function (event) {
|
window.onpopstate = function (event) {
|
||||||
let url = window.location.href;
|
let url = window.location.href;
|
||||||
let thislang = currentlang
|
console.log(url)
|
||||||
if (url.includes('/zh/')) {
|
if (url.endsWith('/#/')) {
|
||||||
thislang = 'zh'
|
window.location.href += 'zh/'
|
||||||
|
return
|
||||||
}
|
}
|
||||||
else if (url.includes('/en/')) {
|
for (let key in navitexts) {
|
||||||
thislang = 'en'
|
if (url.endsWith(`/${key}/`)) {
|
||||||
}
|
window.location.href += 'README'
|
||||||
else if (url.includes('/ru/')) {
|
return
|
||||||
thislang = 'ru'
|
}
|
||||||
}
|
}
|
||||||
|
let thislang = getcurrlang(url)
|
||||||
if (thislang != currentlang) {
|
if (thislang != currentlang) {
|
||||||
currentlang = thislang
|
currentlang = thislang
|
||||||
console.log(navitexts[currentlang])
|
console.log(navitexts[currentlang])
|
||||||
|
@ -1 +0,0 @@
|
|||||||
<meta http-equiv="refresh" content="0; URL=/#/zh/">
|
|
Loading…
x
Reference in New Issue
Block a user