From 0ab5ad2c5dda2d3615fb072b22fc50c955e56ac1 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Wed, 4 Dec 2024 08:46:25 -0800 Subject: [PATCH] fix: fixes language bug where locales were upper case (#3435) --- assets/modules/i18n.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/modules/i18n.ts b/assets/modules/i18n.ts index 56b61e94..10b9e3ab 100644 --- a/assets/modules/i18n.ts +++ b/assets/modules/i18n.ts @@ -42,7 +42,9 @@ await loadLanguage("en", false); // load default language const userLocale = computed( () => locale.value || - [navigator.language, navigator.language.slice(0, 2)].find((l) => availableLocales.includes(l)) || + [navigator.language.toLowerCase(), navigator.language.toLowerCase().slice(0, 2)].find((l) => + availableLocales.includes(l), + ) || "en", );