0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 05:12:57 -05:00

legacy translation support

This commit is contained in:
dragongoose 2024-02-19 11:21:18 -05:00
parent 91d8b79e58
commit 2d905e7c93
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5

View file

@ -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,