chore: missing locale

This commit is contained in:
dongchengjie 2024-06-09 11:16:13 +08:00
parent 444643eb6f
commit 46dc40149e
11 changed files with 85 additions and 36 deletions

View File

@ -0,0 +1,38 @@
import React from "react";
import { Box, styled } from "@mui/material";
type Props = {
label: string;
fontSize?: string;
width?: string;
padding?: string;
children?: React.ReactNode;
};
export const BaseFieldset: React.FC<Props> = (props: Props) => {
const Fieldset = styled(Box)(() => ({
position: "relative",
border: "1px solid #bbb",
borderRadius: "5px",
width: props.width ?? "auto",
padding: props.padding ?? "15px",
}));
const Label = styled("legend")(({ theme }) => ({
position: "absolute",
top: "-10px",
left: props.padding ?? "15px",
backgroundColor: theme.palette.background.paper,
backgroundImage:
"linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16))",
color: theme.palette.text.primary,
fontSize: props.fontSize ?? "1em",
}));
return (
<Fieldset component="fieldset">
<Label>{props.label}</Label>
{props.children}
</Fieldset>
);
};

View File

@ -278,6 +278,7 @@ export const ProfileItem = (props: Props) => {
{/* only if has url can it be updated */} {/* only if has url can it be updated */}
{hasUrl && ( {hasUrl && (
<IconButton <IconButton
title={t("Refresh")}
sx={{ sx={{
position: "absolute", position: "absolute",
p: "3px", p: "3px",

View File

@ -4,7 +4,6 @@ import { useTranslation } from "react-i18next";
import { IconButton, Tooltip } from "@mui/material"; import { IconButton, Tooltip } from "@mui/material";
import { InfoRounded } from "@mui/icons-material"; import { InfoRounded } from "@mui/icons-material";
import { import {
Box,
InputAdornment, InputAdornment,
List, List,
ListItem, ListItem,
@ -19,6 +18,7 @@ import { getSystemProxy, getAutotemProxy } from "@/services/cmds";
import { BaseDialog, DialogRef, Notice, Switch } from "@/components/base"; import { BaseDialog, DialogRef, Notice, Switch } from "@/components/base";
import { Edit } from "@mui/icons-material"; import { Edit } from "@mui/icons-material";
import { EditorViewer } from "@/components/profile/editor-viewer"; import { EditorViewer } from "@/components/profile/editor-viewer";
import { BaseFieldset } from "@/components/base/base-fieldset";
const DEFAULT_PAC = `function FindProxyForURL(url, host) { const DEFAULT_PAC = `function FindProxyForURL(url, host) {
return "PROXY 127.0.0.1:%mixed-port%; SOCKS5 127.0.0.1:%mixed-port%; DIRECT;"; return "PROXY 127.0.0.1:%mixed-port%; SOCKS5 127.0.0.1:%mixed-port%; DIRECT;";
}`; }`;
@ -113,16 +113,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
onOk={onSave} onOk={onSave}
> >
<List> <List>
<Box <BaseFieldset label={t("Current System Proxy")} padding="15px 10px">
sx={{
border: "1px solid #bbb",
borderRadius: "5px",
padding: "8px",
}}
>
<Typography variant="body1" sx={{ fontSize: "18px" }}>
{t("Current System Proxy")}
</Typography>
<FlexBox> <FlexBox>
<Typography className="label">{t("Enable status")}</Typography> <Typography className="label">{t("Enable status")}</Typography>
<Typography className="value"> <Typography className="value">
@ -145,7 +136,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
</FlexBox> </FlexBox>
</> </>
)} )}
</Box> </BaseFieldset>
<ListItem sx={{ padding: "5px 2px" }}> <ListItem sx={{ padding: "5px 2px" }}>
<ListItemText primary={t("Use PAC Mode")} /> <ListItemText primary={t("Use PAC Mode")} />
<Switch <Switch

View File

@ -13,6 +13,7 @@ import {
EditRounded, EditRounded,
OpenInNewRounded, OpenInNewRounded,
} from "@mui/icons-material"; } from "@mui/icons-material";
import { useTranslation } from "react-i18next";
interface Props { interface Props {
value?: string; value?: string;
@ -35,6 +36,7 @@ export const WebUIItem = (props: Props) => {
const [editing, setEditing] = useState(false); const [editing, setEditing] = useState(false);
const [editValue, setEditValue] = useState(value); const [editValue, setEditValue] = useState(value);
const { t } = useTranslation();
if (editing || onlyEdit) { if (editing || onlyEdit) {
return ( return (
@ -45,12 +47,12 @@ export const WebUIItem = (props: Props) => {
size="small" size="small"
value={editValue} value={editValue}
onChange={(e) => setEditValue(e.target.value)} onChange={(e) => setEditValue(e.target.value)}
placeholder={`Support %host %port %secret`} placeholder={t("Support %host, %port, %secret")}
autoComplete="off" autoComplete="off"
/> />
<IconButton <IconButton
size="small" size="small"
title="Save" title={t("Save")}
color="inherit" color="inherit"
onClick={() => { onClick={() => {
onChange(editValue); onChange(editValue);
@ -61,7 +63,7 @@ export const WebUIItem = (props: Props) => {
</IconButton> </IconButton>
<IconButton <IconButton
size="small" size="small"
title="Cancel" title={t("Cancel")}
color="inherit" color="inherit"
onClick={() => { onClick={() => {
onCancel?.(); onCancel?.();
@ -100,7 +102,7 @@ export const WebUIItem = (props: Props) => {
/> />
<IconButton <IconButton
size="small" size="small"
title="Open URL" title={t("Open URL")}
color="inherit" color="inherit"
onClick={() => onOpenUrl?.(value)} onClick={() => onOpenUrl?.(value)}
> >
@ -108,7 +110,7 @@ export const WebUIItem = (props: Props) => {
</IconButton> </IconButton>
<IconButton <IconButton
size="small" size="small"
title="Edit" title={t("Edit")}
color="inherit" color="inherit"
onClick={() => { onClick={() => {
setEditing(true); setEditing(true);
@ -119,7 +121,7 @@ export const WebUIItem = (props: Props) => {
</IconButton> </IconButton>
<IconButton <IconButton
size="small" size="small"
title="Delete" title={t("Delete")}
color="inherit" color="inherit"
onClick={onDelete} onClick={onDelete}
> >

View File

@ -105,10 +105,10 @@ export const WebUIViewer = forwardRef<DialogRef>((props, ref) => {
> >
{!editing && webUIList.length === 0 && ( {!editing && webUIList.length === 0 && (
<BaseEmpty <BaseEmpty
text="Empty List" text="Empty"
extra={ extra={
<Typography mt={2} sx={{ fontSize: "12px" }}> <Typography mt={2} sx={{ fontSize: "12px" }}>
Replace host, port, secret with "%host" "%port" "%secret" {t("Replace host, port, secret with %host, %port, %secret")}
</Typography> </Typography>
} }
/> />

View File

@ -175,7 +175,7 @@ export const TestItem = (props: Props) => {
":hover": { bgcolor: alpha(palette.primary.main, 0.15) }, ":hover": { bgcolor: alpha(palette.primary.main, 0.15) },
})} })}
> >
Check {t("Test")}
</Widget> </Widget>
)} )}

View File

@ -90,6 +90,7 @@
"Update At": "Update At", "Update At": "Update At",
"Logs": "Logs", "Logs": "Logs",
"Pause": "Pause",
"Clear": "Clear", "Clear": "Clear",
"Test": "Test", "Test": "Test",
@ -130,13 +131,13 @@
"Enable status": "Enable Status:", "Enable status": "Enable Status:",
"Enabled": "Enabled", "Enabled": "Enabled",
"Disabled": "Disabled", "Disabled": "Disabled",
"Server Addr": "Server Addr:", "Server Addr": "Server Addr: ",
"Not available": "Not available", "Not available": "Not available",
"Proxy Guard": "Proxy Guard", "Proxy Guard": "Proxy Guard",
"Proxy Guard Info": "Enable to prevent other software from modifying the operating system's proxy settings", "Proxy Guard Info": "Enable to prevent other software from modifying the operating system's proxy settings",
"Guard Duration": "Guard Duration", "Guard Duration": "Guard Duration",
"Proxy Bypass": "Proxy Bypass Settings:", "Proxy Bypass": "Proxy Bypass Settings: ",
"Bypass": "Bypass:", "Bypass": "Bypass: ",
"Use PAC Mode": "Use PAC Mode", "Use PAC Mode": "Use PAC Mode",
"PAC Script Content": "PAC Script Content", "PAC Script Content": "PAC Script Content",
"PAC URL": "PAC URL: ", "PAC URL": "PAC URL: ",
@ -153,6 +154,9 @@
"External Controller": "External Controller", "External Controller": "External Controller",
"Core Secret": "Core Secret", "Core Secret": "Core Secret",
"Recommended": "Recommended", "Recommended": "Recommended",
"Open URL": "Open URL",
"Replace host, port, secret with %host, %port, %secret": "Replace host, port, secret with %host, %port, %secret",
"Support %host, %port, %secret": "Support %host, %port, %secret",
"Clash Core": "Clash Core", "Clash Core": "Clash Core",
"Upgrade": "Upgrade", "Upgrade": "Upgrade",
"Restart": "Restart", "Restart": "Restart",

View File

@ -90,6 +90,7 @@
"Update At": "به‌روزرسانی در", "Update At": "به‌روزرسانی در",
"Logs": "لاگ‌ها", "Logs": "لاگ‌ها",
"Pause": "توقف",
"Clear": "پاک کردن", "Clear": "پاک کردن",
"Test": "آزمون", "Test": "آزمون",
@ -130,16 +131,16 @@
"Enable status": "وضعیت فعال", "Enable status": "وضعیت فعال",
"Enabled": "توانایی فعال شد", "Enabled": "توانایی فعال شد",
"Disabled": "غیرفعال شد", "Disabled": "غیرفعال شد",
"Server Addr": "آدرس سرور", "Server Addr": "آدرس سرور: ",
"Not available": "غیر فعال شد", "Not available": "غیر فعال شد",
"Proxy Guard": "محافظ پراکسی", "Proxy Guard": "محافظ پراکسی",
"Proxy Guard Info": "امکان جلوگیری از نرم‌افزارهای دیگر از تغییر تنظیمات پروکسی سیستم عامل را فعال کنید", "Proxy Guard Info": "امکان جلوگیری از نرم‌افزارهای دیگر از تغییر تنظیمات پروکسی سیستم عامل را فعال کنید",
"Guard Duration": "مدت محافظت", "Guard Duration": "مدت محافظت",
"Proxy Bypass": "دور زدن پراکسی", "Proxy Bypass": "دور زدن پراکسی: ",
"Bypass": "دور زدن", "Bypass": "دور زدن: ",
"Use PAC Mode": "استفاده از حالت PAC", "Use PAC Mode": "استفاده از حالت PAC",
"PAC Script Content": "محتوای اسکریپت PAC", "PAC Script Content": "محتوای اسکریپت PAC",
"PAC URL": "PAC URL", "PAC URL": "PAC URL: ",
"Auto Launch": "راه‌اندازی خودکار", "Auto Launch": "راه‌اندازی خودکار",
"Silent Start": "شروع بی‌صدا", "Silent Start": "شروع بی‌صدا",
@ -153,6 +154,9 @@
"External Controller": "کنترل‌کننده خارجی", "External Controller": "کنترل‌کننده خارجی",
"Core Secret": "رمز اصلی", "Core Secret": "رمز اصلی",
"Recommended": "توصیه شده", "Recommended": "توصیه شده",
"Open URL": "باز کردن آدرس اینترنتی",
"Replace host, port, secret with %host, %port, %secret": "جایگزین کردن میزبان، پورت و رمز با %host، %port، %secret",
"Support %host, %port, %secret": "پشتیبانی از %host، %port و %secret",
"Clash Core": "هسته Clash", "Clash Core": "هسته Clash",
"Upgrade": "ارتقاء", "Upgrade": "ارتقاء",
"Restart": "راه‌اندازی مجدد", "Restart": "راه‌اندازی مجدد",

View File

@ -90,6 +90,7 @@
"Update At": "Обновлено в", "Update At": "Обновлено в",
"Logs": "Логи", "Logs": "Логи",
"Pause": "Пауза",
"Clear": "Очистить", "Clear": "Очистить",
"Test": "Тест", "Test": "Тест",
@ -130,16 +131,16 @@
"Enable status": "Статус включения", "Enable status": "Статус включения",
"Enabled": "Включено", "Enabled": "Включено",
"Disabled": "Отключено", "Disabled": "Отключено",
"Server Addr": "Адрес сервера", "Server Addr": "Адрес сервера: ",
"Not available": "Недоступно", "Not available": "Недоступно",
"Proxy Guard": "Защита прокси", "Proxy Guard": "Защита прокси",
"Proxy Guard Info": "Включите эту функцию чтобы предотвратить изменение настроек прокси-сервера операционной системы другим программным обеспечением", "Proxy Guard Info": "Включите эту функцию чтобы предотвратить изменение настроек прокси-сервера операционной системы другим программным обеспечением",
"Guard Duration": "Период защиты", "Guard Duration": "Период защиты",
"Proxy Bypass": "Игнорирование прокси", "Proxy Bypass": "Игнорирование прокси: ",
"Bypass": "Игнорирование", "Bypass": "Игнорирование: ",
"Use PAC Mode": "Используйте режим PAC.", "Use PAC Mode": "Используйте режим PAC",
"PAC Script Content": "Содержание сценария PAC", "PAC Script Content": "Содержание сценария PAC",
"PAC URL": "Адрес PAC", "PAC URL": "Адрес PAC: ",
"Auto Launch": "Автозапуск", "Auto Launch": "Автозапуск",
"Silent Start": "Тихий запуск", "Silent Start": "Тихий запуск",
@ -153,6 +154,9 @@
"External Controller": "Адрес прослушивания внешнего контроллера", "External Controller": "Адрес прослушивания внешнего контроллера",
"Core Secret": "Секрет", "Core Secret": "Секрет",
"Recommended": "Рекомендуется", "Recommended": "Рекомендуется",
"Open URL": "Открыть URL",
"Replace host, port, secret with %host, %port, %secret": "Замените хост, порт, секрет на %host, %port, %secret",
"Support %host, %port, %secret": "Поддержка %host, %port, %secret",
"Clash Core": "Ядра Clash", "Clash Core": "Ядра Clash",
"Upgrade": "Обновлять", "Upgrade": "Обновлять",
"Restart": "Перезапуск", "Restart": "Перезапуск",

View File

@ -90,6 +90,7 @@
"Update At": "更新于", "Update At": "更新于",
"Logs": "日志", "Logs": "日志",
"Pause": "暂停",
"Clear": "清除", "Clear": "清除",
"Test": "测试", "Test": "测试",
@ -128,8 +129,8 @@
"System Proxy Setting": "系统代理设置", "System Proxy Setting": "系统代理设置",
"Current System Proxy": "当前系统代理", "Current System Proxy": "当前系统代理",
"Enable status": "开启状态:", "Enable status": "开启状态:",
"Enabled": "成功", "Enabled": "已启用",
"Disabled": "失败", "Disabled": "未启用",
"Server Addr": "服务地址:", "Server Addr": "服务地址:",
"Not available": "不可用", "Not available": "不可用",
"Proxy Guard": "系统代理守卫", "Proxy Guard": "系统代理守卫",
@ -153,6 +154,9 @@
"External Controller": "外部控制器监听地址", "External Controller": "外部控制器监听地址",
"Core Secret": "API 访问密钥", "Core Secret": "API 访问密钥",
"Recommended": "建议设置", "Recommended": "建议设置",
"Open URL": "打开链接",
"Replace host, port, secret with %host, %port, %secret": "使用 %host, %port, %secret 表示 主机, 端口, 访问密钥",
"Support %host, %port, %secret": "支持 %host, %port, %secret",
"Clash Core": "Clash 内核", "Clash Core": "Clash 内核",
"Upgrade": "升级内核", "Upgrade": "升级内核",
"Restart": "重启内核", "Restart": "重启内核",
@ -199,7 +203,7 @@
"App Log Level": "App日志等级", "App Log Level": "App日志等级",
"Auto Close Connections": "自动关闭连接", "Auto Close Connections": "自动关闭连接",
"Auto Check Update": "自动检查更新", "Auto Check Update": "自动检查更新",
"Enable Builtin Enhanced": "开启内建增强功能", "Enable Builtin Enhanced": "内置增强功能",
"Proxy Layout Column": "代理页布局列数", "Proxy Layout Column": "代理页布局列数",
"Auto Log Clean": "自动清理日志", "Auto Log Clean": "自动清理日志",
"Never Clean": "不清理", "Never Clean": "不清理",

View File

@ -39,6 +39,7 @@ const LogPage = () => {
header={ header={
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}> <Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
<IconButton <IconButton
title={t("Pause")}
size="small" size="small"
color="inherit" color="inherit"
onClick={() => setEnableLog((e) => !e)} onClick={() => setEnableLog((e) => !e)}