From 407a2fb12e90b77a0e04e8a199c8e9accd8fa55c Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 24 Oct 2021 12:59:53 +0200 Subject: :bug: fix locales --- api/client_test/index.html | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/api/client_test/index.html b/api/client_test/index.html index 5a795253..a68b191a 100644 --- a/api/client_test/index.html +++ b/api/client_test/index.html @@ -105,8 +105,40 @@ }); } + const supportedLocales = [ + "bg", + "cs", + "da", + "de", + "el", + "en-GB", + "es-ES", + "fi", + "fr", + "hi", + "hr", + "hu", + "it", + "ja", + "ko", + "lt", + "nl", + "no", + "pl", + "pt-BR", + "ro", + "ru", + "sv-SE", + "th", + "tr", + "uk", + "vi", + "zh-CN", + "zh-TW" + ]; + const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); - if (settings && settings.locale.length <= 2) { + if (settings && !supportedLocales.includes(settings.locale)) { // fix client locale wrong and client not loading at all settings.locale = "en-US"; localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); -- cgit 1.4.1