summary refs log tree commit diff
path: root/api/client_test
diff options
context:
space:
mode:
authorSamuel <34555296+Flam3rboy@users.noreply.github.com>2021-10-24 09:05:43 -0400
committerGitHub <noreply@github.com>2021-10-24 09:05:43 -0400
commit715e7c97c453c84b496e9629af37d9ac5798419d (patch)
tree3fffabf427fe31a432a1492e7718a0469fc079f3 /api/client_test
parentNew translations auth.json (Spanish, Latin America) (diff)
parent:bug: fix locales (diff)
downloadserver-715e7c97c453c84b496e9629af37d9ac5798419d.tar.xz
Merge branch 'master' into translation
Diffstat (limited to 'api/client_test')
-rw-r--r--api/client_test/index.html34
1 files changed, 33 insertions, 1 deletions
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));