From dd09c3b39474e146aaf183fc35ddbc93b9f0512c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 27 Mar 2017 04:49:31 +0900 Subject: [PATCH] [Client] Better language detection --- src/web/app/client/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/app/client/script.js b/src/web/app/client/script.js index aafd91748..1ad45b333 100644 --- a/src/web/app/client/script.js +++ b/src/web/app/client/script.js @@ -5,7 +5,7 @@ const head = document.getElementsByTagName('head')[0]; // Detect user language - let lang = ((navigator.languages && navigator.languages[0]) || navigator.language).split('-')[0].toLowerCase(); + let lang = navigator.language.split('-')[0]; if (!/^(en|ja)$/.test(lang)) lang = 'en'; // Detect user agent