diff --git a/src/filters/datetime.ts b/src/filters/datetime.ts index c1f812739..b9e0cebcb 100644 --- a/src/filters/datetime.ts +++ b/src/filters/datetime.ts @@ -79,7 +79,7 @@ function formatDateTimeString( return format.format(parseDateTime(value)); } -const locale = () => i18n.global.locale.replace("_", "-"); +const locale = () => i18n.global.locale.value.replace("_", "-"); export { formatDateISOStringWithoutTime, diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index bae4287ee..e7641008e 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -26,7 +26,7 @@ export const locale = ? language : language.split("-")[0]; -export const i18n = createI18n({ +export const i18n = createI18n({ legacy: false, locale: locale, // set locale // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -77,11 +77,6 @@ function vueI18NfileForLanguage(lang: string) { } export async function loadLanguageAsync(lang: string): Promise { - // If the same language - if (i18n.global.locale === lang) { - return Promise.resolve(setI18nLanguage(lang)); - } - // If the language was already loaded if (loadedLanguages.includes(lang)) { return Promise.resolve(setI18nLanguage(lang));