From dfa6eb760d51263b051f72d0fe968458d369f187 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Sat, 29 Feb 2020 03:51:41 +0100 Subject: [PATCH] Fix language detection --- client/src/store.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/store.js b/client/src/store.js index e7e86971..52870e0a 100644 --- a/client/src/store.js +++ b/client/src/store.js @@ -60,9 +60,10 @@ export const store = { highlight: localStorage.getItem("highlight") == "true" }; const supportedLangs = ["en", "es", "fr"]; + const navLanguage = navigator.language.substr(0,2); this.state.lang = localStorage["lang"] || - (supportedLangs.includes(navigator.language) ? navigator.language : "en"); + (supportedLangs.includes(navLanguage) ? navLanguage : "en"); this.setTranslations(); }, updateSetting: function(propName, value) { -- 2.44.0