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:
parent
91d8b79e58
commit
2d905e7c93
1 changed files with 13 additions and 2 deletions
15
src/i18n.ts
15
src/i18n.ts
|
@ -15,10 +15,21 @@ import uk from '@/locales/uk.json'
|
||||||
import de from '@/locales/de.json'
|
import de from '@/locales/de.json'
|
||||||
import zh_Hans from '@/locales/zh_Hans.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({
|
export default createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale: import.meta.env.SAFETWITCH_DEFAULT_LOCALE || 'en-US',
|
locale,
|
||||||
fallbackLocale: import.meta.env.SAFETWITCH_FALLBACK_LOCALE || 'en-US',
|
fallbackLocale,
|
||||||
globalInjection: true,
|
globalInjection: true,
|
||||||
messages: {
|
messages: {
|
||||||
'en-US': en,
|
'en-US': en,
|
||||||
|
|
Loading…
Reference in a new issue