fix: change the ui locale

This commit is contained in:
kolaente 2021-10-17 14:01:15 +02:00
parent 74d785d606
commit 2fc96cb6a7
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -21,14 +21,15 @@ export const availableLanguages = {
const loadedLanguages = ['en'] // our default language that is preloaded
const setI18nLanguage = lang => {
i18n.locale = lang
i18n.global.locale = lang
document.querySelector('html').setAttribute('lang', lang)
return lang
}
export const loadLanguageAsync = lang => {
console.log(lang, i18n.global.locale)
// If the same language
if (i18n.locale === lang) {
if (i18n.global.locale === lang) {
return Promise.resolve(setI18nLanguage(lang))
}