LunaTranslator/docs/index.html
HIllya51 1791d86ffb .
2025-07-10 12:09:19 +08:00

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>