feat: Support Persian

#715
This commit is contained in:
MystiPanda 2024-03-21 20:51:33 +08:00
parent ddf6760543
commit 3dbb71a076
3 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ import { LayoutViewer } from "./mods/layout-viewer";
import { UpdateViewer } from "./mods/update-viewer";
import getSystem from "@/utils/get-system";
import { routers } from "@/pages/_routers";
import { appWindow } from "@tauri-apps/api/window";
interface Props {
onError?: (err: Error) => void;
}
@ -97,6 +97,7 @@ const SettingVerge = ({ onError }: Props) => {
<MenuItem value="zh"></MenuItem>
<MenuItem value="en">English</MenuItem>
<MenuItem value="ru">Русский</MenuItem>
<MenuItem value="fa">فارسی</MenuItem>
</Select>
</GuardState>
</SettingItem>

1
src/locales/fa.json Normal file
View File

@ -0,0 +1 @@
{}

View File

@ -3,16 +3,19 @@ import { initReactI18next } from "react-i18next";
import en from "@/locales/en.json";
import ru from "@/locales/ru.json";
import zh from "@/locales/zh.json";
import fa from "@/locales/fa.json";
const resources = {
en: { translation: en },
ru: { translation: ru },
zh: { translation: zh },
fa: { translation: fa },
};
i18n.use(initReactI18next).init({
resources,
lng: "en",
fallbackLng: "en",
interpolation: {
escapeValue: false,
},