Skip to content

Commit

Permalink
fix: redirect to top
Browse files Browse the repository at this point in the history
  • Loading branch information
lilxyzw committed Oct 14, 2024
1 parent 6313d56 commit b6dc1ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/public/scripts/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ if(hash.length != 0)
{
hash = hash.substring(7);
}
if(hash.startsWith('/'))
{
hash = hash.substring(1);
}
const lang = window.navigator.language || window.navigator.userLanguage || window.navigator.browserLanguage;
if(lang.startsWith('ja')) location.href = `${url}ja_JP/${hash}`;
else location.href = `${url}ja_JP/${hash}`;
Expand Down

0 comments on commit b6dc1ba

Please # to comment.