feat(i18n): use settings to set and get language

This commit is contained in:
2026-08-07 00:33:17 +02:00
parent d5f6108f47
commit b571a68e3b
4 changed files with 38 additions and 55 deletions
+7 -1
View File
@@ -57,4 +57,10 @@ export async function loadLanguage (locale) {
i18n.global.locale.value = locale;
loadedLanguages.add(locale);
};
};
export const setLocale = async function setLocale (locale) {
await loadLanguage(locale);
document.documentElement.lang = locale;
document.documentElement.dir = LANGUAGES_RTL.includes(locale) ? 'rtl' : 'ltr';
};