chore: add ja locale

This commit is contained in:
Steven
2024-07-15 22:26:46 +08:00
parent 9b6ba2a5bb
commit 5dca1373fc
11 changed files with 112 additions and 86 deletions

View File

@ -24,6 +24,10 @@ const PreferenceSection: React.FC = () => {
value: UserSetting_Locale.LOCALE_FR,
label: "Français",
},
{
value: UserSetting_Locale.LOCALE_JA,
label: "日本語",
},
];
const colorThemeOptions = [

View File

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

View File

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