diff --git a/src/i18n.ts b/src/i18n.ts index a594416..981b901 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -15,10 +15,21 @@ import uk from '@/locales/uk.json' import de from '@/locales/de.json' import zh_Hans from '@/locales/zh_Hans.json' +let locale = import.meta.env.SAFETWITCH_DEFAULT_LOCALE || 'en-US' +const fallbackLocale = import.meta.env.SAFETWITCH_FALLBACK_LOCALE || 'en-US' + +if (locale == 'en' ) { + locale = 'en-US' +} + +if (fallbackLocale == 'en' ) { + locale = 'en-US' +} + export default createI18n({ legacy: false, - locale: import.meta.env.SAFETWITCH_DEFAULT_LOCALE || 'en-US', - fallbackLocale: import.meta.env.SAFETWITCH_FALLBACK_LOCALE || 'en-US', + locale, + fallbackLocale, globalInjection: true, messages: { 'en-US': en,