[Client] Fix bug

This commit is contained in:
syuilo 2017-03-25 17:09:44 +09:00
parent 7be48285e2
commit 0bab5ce27d

View File

@ -5,8 +5,8 @@
const head = document.getElementsByTagName('head')[0];
// Detect user language
let lang = (navigator.languages && navigator.languages[0]) || navigator.language;
if (!/en|en\-US|ja/.test(lang)) lang = 'en';
let lang = ((navigator.languages && navigator.languages[0]) || navigator.language).split('-')[0].toLowerCase();
if (!/^(en|ja)$/.test(lang)) lang = 'en';
// Detect user agent
const ua = navigator.userAgent.toLowerCase();