add i18n (fix=>fr,add=>zhtw) resources

This commit is contained in:
godchadigo
2025-06-13 00:00:31 +08:00
committed by Vaala Cat
parent 87a28b831c
commit a99de89294
2 changed files with 16 additions and 0 deletions

View File

@@ -2,7 +2,9 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { $language } from '@/store/user';
import enTranslation from './locales/en.json';
import frTranslation from './locales/fr.json';
import zhTranslation from './locales/zh.json';
import zhtwTranslation from './locales/zhtw.json';
const savedLanguage = $language.get();
@@ -13,9 +15,15 @@ i18n
en: {
translation: enTranslation,
},
fr: {
translation: frTranslation,
},
zh: {
translation: zhTranslation,
},
zhtw: {
translation: zhtwTranslation,
},
},
lng: savedLanguage || 'zh',
fallbackLng: 'zh',

View File

@@ -2,7 +2,9 @@ import i18next from 'i18next'
import { initReactI18next } from 'react-i18next'
import { atom } from 'nanostores'
import enTranslations from '../i18n/locales/en.json'
import frTranslations from '../i18n/locales/fr.json'
import zhTranslations from '../i18n/locales/zh.json'
import zhtwTranslations from '../i18n/locales/zhtw.json'
const LANGUAGE_KEY = 'LANGUAGE'
@@ -23,9 +25,15 @@ i18n
en: {
translation: enTranslations,
},
fr: {
translation: frTranslations,
},
zh: {
translation: zhTranslations,
},
zhtw:{
translation: zhtwTranslations,
}
},
lng: getInitialLanguage(),
fallbackLng: 'zh',