1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 19:02:33 +01:00

🐛 fix locales

This commit is contained in:
Flam3rboy 2021-10-24 12:59:53 +02:00
parent bff6087c8b
commit 7a6025574a

View File

@ -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));