mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-30 00:13:06 +00:00
[Client] Fix bug
This commit is contained in:
parent
7be48285e2
commit
0bab5ce27d
1 changed files with 2 additions and 2 deletions
|
@ -5,8 +5,8 @@
|
||||||
const head = document.getElementsByTagName('head')[0];
|
const head = document.getElementsByTagName('head')[0];
|
||||||
|
|
||||||
// Detect user language
|
// Detect user language
|
||||||
let lang = (navigator.languages && navigator.languages[0]) || navigator.language;
|
let lang = ((navigator.languages && navigator.languages[0]) || navigator.language).split('-')[0].toLowerCase();
|
||||||
if (!/en|en\-US|ja/.test(lang)) lang = 'en';
|
if (!/^(en|ja)$/.test(lang)) lang = 'en';
|
||||||
|
|
||||||
// Detect user agent
|
// Detect user agent
|
||||||
const ua = navigator.userAgent.toLowerCase();
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
|
|
Loading…
Reference in a new issue