summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-24 12:59:53 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-24 12:59:53 +0200
commit407a2fb12e90b77a0e04e8a199c8e9accd8fa55c (patch)
tree6e96a7b8feac189c29b9ffe8b980c706d6b31744
parent:bug: fix event listener (diff)
downloadserver-407a2fb12e90b77a0e04e8a199c8e9accd8fa55c.tar.xz
:bug: fix locales
-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));