mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-04 04:23:16 +00:00
chore: support fr locale
This commit is contained in:
@ -20,6 +20,10 @@ const PreferenceSection: React.FC = () => {
|
||||
value: UserSetting_Locale.LOCALE_ZH,
|
||||
label: "中文",
|
||||
},
|
||||
{
|
||||
value: UserSetting_Locale.LOCALE_FR,
|
||||
label: "Français",
|
||||
},
|
||||
];
|
||||
|
||||
const colorThemeOptions = [
|
||||
|
@ -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",
|
||||
|
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user