mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04: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 = {
|
||||
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'
|
||||
}
|
||||
else if (url.includes('/ru/')) {
|
||||
thislang = 'ru'
|
||||
for (let key in navitexts) {
|
||||
if (url.endsWith(`/${key}/`)) {
|
||||
window.location.href += 'README'
|
||||
return
|
||||
}
|
||||
}
|
||||
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