chore: support fr locale

This commit is contained in:
Steven
2024-05-21 21:57:03 +08:00
parent 4444c72042
commit 6746b9dc58
17 changed files with 216 additions and 197 deletions

View File

@ -20,6 +20,10 @@ const PreferenceSection: React.FC = () => {
value: UserSetting_Locale.LOCALE_ZH,
label: "中文",
},
{
value: UserSetting_Locale.LOCALE_FR,
label: "Français",
},
];
const colorThemeOptions = [

View File

@ -1,6 +1,7 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "../../locales/en.json";
import fr from "../../locales/fr.json";
import zh from "../../locales/zh.json";
i18n.use(initReactI18next).init({
@ -11,6 +12,9 @@ i18n.use(initReactI18next).init({
zh: {
translation: zh,
},
fr: {
translation: fr,
},
},
lng: "en",
fallbackLng: "en",

View File

@ -37,6 +37,8 @@ const Root: React.FC = () => {
if (isEqual(currentUserSetting.locale, UserSetting_Locale.LOCALE_ZH)) {
i18n.changeLanguage("zh");
} else if (isEqual(currentUserSetting.locale, UserSetting_Locale.LOCALE_FR)) {
i18n.changeLanguage("fr");
} else {
i18n.changeLanguage("en");
}