Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HIllya51 committed Jan 19, 2025
1 parent fccc053 commit fc757f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<head>
<link rel="icon" href="https://image.lunatranslator.org/luna.ico" type="image/x-icon">
<script>
const supportlangs = ['zh', 'en', 'ja']
function browserlang() {
let l = navigator.language
if (l.includes('-')) l = l.split('-')[0]
if (supportlangs.includes(l)) return l
return 'en'
}
let lang = window.localStorage.currentlang ? window.localStorage.currentlang : browserlang()
window.location.pathname = `/${lang}/`
</script>
Expand Down

0 comments on commit fc757f5

Please sign in to comment.