Merge branch 'languagefixes' into dev

# Conflicts:
#	src-tauri/Cargo.lock
#	src-tauri/Cargo.toml
#	src-tauri/src/core/tray/mod.rs
This commit is contained in:
huzibaca
2025-01-11 15:07:30 +08:00
15 changed files with 1626 additions and 55 deletions

View File

@@ -28,6 +28,7 @@ import getSystem from "@/utils/get-system";
import { routers } from "@/pages/_routers";
import { TooltipIcon } from "@/components/base/base-tooltip-icon";
import { ContentCopyRounded } from "@mui/icons-material";
import { languages } from "@/services/i18n";
interface Props {
onError?: (err: Error) => void;
@@ -35,6 +36,19 @@ interface Props {
const OS = getSystem();
const languageOptions = Object.entries(languages).map(([code, _]) => {
const labels: { [key: string]: string } = {
en: "English",
ru: "Русский",
zh: "中文",
fa: "فارسی",
tt: "Татар",
id: "Bahasa Indonesia",
ar: "العربية",
};
return { code, label: labels[code] };
});
const SettingVerge = ({ onError }: Props) => {
const { t } = useTranslation();
@@ -96,10 +110,11 @@ const SettingVerge = ({ onError }: Props) => {
onGuard={(e) => patchVerge({ language: e })}
>
<Select size="small" sx={{ width: 110, "> div": { py: "7.5px" } }}>
<MenuItem value="zh"></MenuItem>
<MenuItem value="en">English</MenuItem>
<MenuItem value="ru">Русский</MenuItem>
<MenuItem value="fa">فارسی</MenuItem>
{languageOptions.map(({ code, label }) => (
<MenuItem key={code} value={code}>
{label}
</MenuItem>
))}
</Select>
</GuardState>
</SettingItem>