mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-11-28 00:50:21 +08:00
21 lines
No EOL
701 B
HTML
21 lines
No EOL
701 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<link rel="icon" href="https://image.lunatranslator.org/luna.ico" type="image/x-icon">
|
|
<script>
|
|
const supportlangs = ['zh', 'en', 'ja', 'vi', 'ko', 'ru']
|
|
function browserlang() {
|
|
let l = navigator.language
|
|
let ls = l.split('-')
|
|
if (ls.length) l = ls[0]
|
|
if (l == 'zh' && ls.length == 2 && (ls[1] == 'HK' || ls[1] == 'TW')) return 'cht'
|
|
if (supportlangs.includes(l)) return l
|
|
return 'en'
|
|
}
|
|
let lang = window.localStorage.currentlang ? window.localStorage.currentlang : browserlang()
|
|
window.location.pathname = `/${lang}/`
|
|
</script>
|
|
</head>
|
|
|
|
</html> |