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