chore: update notification message and zh translation (#1011)

This commit is contained in:
RikudouPatrickstar 2024-05-12 14:40:18 +08:00 committed by GitHub
parent 0f2af91a04
commit e79f036a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 64 additions and 26 deletions

View File

@ -52,7 +52,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
mutate("getClashConfig"); mutate("getClashConfig");
mutate("getVersion"); mutate("getVersion");
}, 100); }, 100);
Notice.success(`Successfully switch to ${core}`, 1000); Notice.success(t("Switched to _clash Core", { core: `${core}` }), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err?.message || err.toString()); Notice.error(err?.message || err.toString());
} }
@ -63,7 +63,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
await grantPermission(core); await grantPermission(core);
// 自动重启 // 自动重启
if (core === clash_core) await restartSidecar(); if (core === clash_core) await restartSidecar();
Notice.success(`Successfully grant permission to ${core}`, 1000); Notice.success(t("Permissions Granted Successfully for _clash Core", { core: `${core}` }), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err?.message || err.toString()); Notice.error(err?.message || err.toString());
} }
@ -72,7 +72,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
const onRestart = useLockFn(async () => { const onRestart = useLockFn(async () => {
try { try {
await restartSidecar(); await restartSidecar();
Notice.success(`Successfully restart core`, 1000); Notice.success(t(`Clash Core Restarted`), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err?.message || err.toString()); Notice.error(err?.message || err.toString());
} }
@ -83,7 +83,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
setUpgrading(true); setUpgrading(true);
await upgradeCore(); await upgradeCore();
setUpgrading(false); setUpgrading(false);
Notice.success(`Successfully upgrade core`, 1000); Notice.success(t(`Core Version Updated`), 1000);
} catch (err: any) { } catch (err: any) {
setUpgrading(false); setUpgrading(false);
Notice.error(err?.response.data.message || err.toString()); Notice.error(err?.response.data.message || err.toString());

View File

@ -79,18 +79,18 @@ export const ClashPortViewer = forwardRef<DialogRef>((props, ref) => {
OS === "linux" && OS === "linux" &&
new Set([redirPort, tproxyPort, mixedPort, socksPort, port]).size !== 5 new Set([redirPort, tproxyPort, mixedPort, socksPort, port]).size !== 5
) { ) {
Notice.error("Port conflict!", 4000); Notice.error(t("Port Conflict"), 4000);
return; return;
} }
if ( if (
OS === "macos" && OS === "macos" &&
new Set([redirPort, mixedPort, socksPort, port]).size !== 4 new Set([redirPort, mixedPort, socksPort, port]).size !== 4
) { ) {
Notice.error("Port conflict!", 4000); Notice.error(t("Port Conflict"), 4000);
return; return;
} }
if (OS === "windows" && new Set([mixedPort, socksPort, port]).size !== 3) { if (OS === "windows" && new Set([mixedPort, socksPort, port]).size !== 3) {
Notice.error("Port conflict!", 4000); Notice.error(t("Port Conflict"), 4000);
return; return;
} }
try { try {
@ -113,7 +113,7 @@ export const ClashPortViewer = forwardRef<DialogRef>((props, ref) => {
await patchVerge({ verge_socks_enabled: socksEnabled }); await patchVerge({ verge_socks_enabled: socksEnabled });
await patchVerge({ verge_http_enabled: httpEnabled }); await patchVerge({ verge_http_enabled: httpEnabled });
setOpen(false); setOpen(false);
Notice.success("Change Clash port successfully!", 1000); Notice.success(t("Clash Port Modified"), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err.message || err.toString(), 4000); Notice.error(err.message || err.toString(), 4000);
} }

View File

@ -26,7 +26,7 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
const onSave = useLockFn(async () => { const onSave = useLockFn(async () => {
try { try {
await patchInfo({ "external-controller": controller, secret }); await patchInfo({ "external-controller": controller, secret });
Notice.success("Change Clash Config successfully!", 1000); Notice.success(t("External Controller Address Modified"), 1000);
setOpen(false); setOpen(false);
} catch (err: any) { } catch (err: any) {
Notice.error(err.message || err.toString(), 4000); Notice.error(err.message || err.toString(), 4000);

View File

@ -43,7 +43,7 @@ export const ServiceViewer = forwardRef<DialogRef, Props>((props, ref) => {
await installService(); await installService();
mutateCheck(); mutateCheck();
setOpen(false); setOpen(false);
Notice.success("Service installed successfully"); Notice.success(t("Service Installed Successfully"));
} catch (err: any) { } catch (err: any) {
mutateCheck(); mutateCheck();
Notice.error(err.message || err.toString()); Notice.error(err.message || err.toString());
@ -59,7 +59,7 @@ export const ServiceViewer = forwardRef<DialogRef, Props>((props, ref) => {
await uninstallService(); await uninstallService();
mutateCheck(); mutateCheck();
setOpen(false); setOpen(false);
Notice.success("Service uninstalled successfully"); Notice.success(t("Service Uninstalled Successfully"));
} catch (err: any) { } catch (err: any) {
mutateCheck(); mutateCheck();
Notice.error(err.message || err.toString()); Notice.error(err.message || err.toString());

View File

@ -53,7 +53,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
const onSave = useLockFn(async () => { const onSave = useLockFn(async () => {
if (value.duration < 1) { if (value.duration < 1) {
Notice.error("Proxy guard duration at least 1 seconds"); Notice.error(t("Proxy Daemon Duration Cannot be Less than 1 Second"));
return; return;
} }

View File

@ -68,7 +68,7 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
); );
try { try {
await enhanceProfiles(); await enhanceProfiles();
Notice.success("Refresh clash config", 1000); Notice.success(t("Settings Applied"), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err.message || err.toString(), 3000); Notice.error(err.message || err.toString(), 3000);
} }

View File

@ -54,7 +54,7 @@ const SettingClash = ({ onError }: Props) => {
const onUpdateGeo = useLockFn(async () => { const onUpdateGeo = useLockFn(async () => {
try { try {
await updateGeoData(); await updateGeoData();
Notice.success("Start update geodata"); Notice.success(t("GeoData Updated"));
} catch (err: any) { } catch (err: any) {
Notice.error(err?.response.data.message || err.toString()); Notice.error(err?.response.data.message || err.toString());
} }
@ -120,7 +120,7 @@ const SettingClash = ({ onError }: Props) => {
color={enable_random_port ? "primary" : "inherit"} color={enable_random_port ? "primary" : "inherit"}
size="small" size="small"
onClick={() => { onClick={() => {
Notice.success(t("After restart to take effect"), 1000); Notice.success(t("Restart Application to Apply Modifications"), 1000);
onChangeVerge({ enable_random_port: !enable_random_port }); onChangeVerge({ enable_random_port: !enable_random_port });
patchVerge({ enable_random_port: !enable_random_port }); patchVerge({ enable_random_port: !enable_random_port });
}} }}

View File

@ -67,7 +67,7 @@ const SettingVerge = ({ onError }: Props) => {
try { try {
const info = await checkUpdate(); const info = await checkUpdate();
if (!info?.shouldUpdate) { if (!info?.shouldUpdate) {
Notice.success("No Updates Available"); Notice.success(t("Currently on the Latest Version"));
} else { } else {
updateRef.current?.open(); updateRef.current?.open();
} }

View File

@ -85,7 +85,7 @@
"Log Level": "Log Level", "Log Level": "Log Level",
"Port Config": "Port Config", "Port Config": "Port Config",
"Random Port": "Random Port", "Random Port": "Random Port",
"After restart to take effect": "After restart to take effect", "Restart Application to Apply Modifications": "Restart Application to Apply Modifications",
"External": "External", "External": "External",
"External Controller": "External Controller", "External Controller": "External Controller",
"Core Secret": "Core Secret", "Core Secret": "Core Secret",
@ -200,5 +200,24 @@
"System and Mixed Can Only be Used in Service Mode": "System and Mixed Can Only be Used in Service Mode", "System and Mixed Can Only be Used in Service Mode": "System and Mixed Can Only be Used in Service Mode",
"Information: Please make sure that the Clash Verge Service is installed and enabled": "Information: Please make sure that the Clash Verge Service is installed and enabled", "Information: Please make sure that the Clash Verge Service is installed and enabled": "Information: Please make sure that the Clash Verge Service is installed and enabled",
"Use Regular Expression": "Use Regular Expression" "Use Regular Expression": "Use Regular Expression",
"External Controller Address Modified": "External Controller Address Modified",
"Clash Port Modified": "Clash Port Modified",
"Currently on the Latest Version": "Currently on the Latest Version",
"Only YAML Files Supported": "Only YAML Files Supported",
"Port Conflict": "Port Conflict",
"Proxy Daemon Duration Cannot be Less than 1 Second": "Proxy Daemon Duration Cannot be Less than 1 Second",
"Profile Switched": "Profile Switched",
"Profile Reactivated": "Profile Reactivated",
"Clash Config Updated": "Clash Config Updated",
"Settings Applied": "Settings Applied",
"Service Installed Successfully": "Service Installed Successfully",
"Service Uninstalled Successfully": "Service Uninstalled Successfully",
"GeoData Updated": "GeoData Updated",
"Permissions Granted Successfully for _clash Core": "Permissions Granted Successfully for {{core}} Core",
"Profile Imported Successfully": "Profile Imported Successfully",
"Clash Core Restarted": "Clash Core Restarted",
"Switched to _clash Core": "Switched to {{core}} Core",
"Core Version Updated": "Core Version Updated"
} }

View File

@ -85,7 +85,7 @@
"Log Level": "Уровень логов", "Log Level": "Уровень логов",
"Port Config": "Настройка порта", "Port Config": "Настройка порта",
"Random Port": "Случайный порт", "Random Port": "Случайный порт",
"After restart to take effect": "Чтобы изменения вступили в силу, необходимо перезапустить приложение", "Restart Application to Apply Modifications": "Чтобы изменения вступили в силу, необходимо перезапустить приложение",
"External": "Внешний", "External": "Внешний",
"External Controller": "Адрес прослушивания внешнего контроллера", "External Controller": "Адрес прослушивания внешнего контроллера",
"Core Secret": "Секрет", "Core Secret": "Секрет",

View File

@ -85,7 +85,7 @@
"Log Level": "日志等级", "Log Level": "日志等级",
"Port Config": "端口设置", "Port Config": "端口设置",
"Random Port": "随机端口", "Random Port": "随机端口",
"After restart to take effect": "重启后生效", "Restart Application to Apply Modifications": "重启应用程序以应用修改",
"External": "外部控制", "External": "外部控制",
"External Controller": "外部控制器监听地址", "External Controller": "外部控制器监听地址",
"Core Secret": "API 访问密钥", "Core Secret": "API 访问密钥",
@ -200,5 +200,24 @@
"System and Mixed Can Only be Used in Service Mode": "System 和 Mixed 只能在服务模式下使用", "System and Mixed Can Only be Used in Service Mode": "System 和 Mixed 只能在服务模式下使用",
"Information: Please make sure that the Clash Verge Service is installed and enabled": "提示信息: 请确保 Clash Verge Service 已安装并启用", "Information: Please make sure that the Clash Verge Service is installed and enabled": "提示信息: 请确保 Clash Verge Service 已安装并启用",
"Use Regular Expression": "使用正则表达式" "Use Regular Expression": "使用正则表达式",
"External Controller Address Modified": "外部控制器监听地址已修改",
"Clash Port Modified": "Clash 端口已修改",
"Currently on the Latest Version": "当前已是最新版本",
"Only YAML Files Supported": "仅支持 YAML 文件",
"Port Conflict": "端口冲突",
"Proxy Daemon Duration Cannot be Less than 1 Second": "代理守护间隔时间不得低于1秒",
"Profile Switched": "订阅已切换",
"Profile Reactivated": "订阅已激活",
"Clash Config Updated": "Clash 配置已更新",
"Settings Applied": "设置已应用",
"Service Installed Successfully": "已成功安装服务",
"Service Uninstalled Successfully": "已成功卸载服务",
"GeoData Updated": "已更新 GeoData",
"Permissions Granted Successfully for _clash Core": "{{core}} 内核授权成功",
"Profile Imported Successfully": "导入订阅成功",
"Clash Core Restarted": "已重启 Clash 内核",
"Switched to _clash Core": "已切换至 {{core}} 内核",
"Core Version Updated": "内核版本已更新"
} }

View File

@ -72,7 +72,7 @@ const Layout = () => {
const [status, msg] = payload as [string, string]; const [status, msg] = payload as [string, string];
switch (status) { switch (status) {
case "set_config::ok": case "set_config::ok":
Notice.success("Refresh clash config"); Notice.success(t("Clash Config Updated"));
break; break;
case "set_config::error": case "set_config::error":
Notice.error(msg); Notice.error(msg);

View File

@ -72,7 +72,7 @@ const ProfilePage = () => {
const fileList = event.payload as string[]; const fileList = event.payload as string[];
for (let file of fileList) { for (let file of fileList) {
if (!file.endsWith(".yaml") && !file.endsWith(".yml")) { if (!file.endsWith(".yaml") && !file.endsWith(".yml")) {
Notice.error("Only support YAML files."); Notice.error(t("Only YAML Files Supported"));
continue; continue;
} }
const item = { const item = {
@ -136,7 +136,7 @@ const ProfilePage = () => {
try { try {
await importProfile(url); await importProfile(url);
Notice.success("Successfully import profile."); Notice.success(t("Profile Imported Successfully"));
setUrl(""); setUrl("");
setLoading(false); setLoading(false);
@ -179,7 +179,7 @@ const ProfilePage = () => {
mutateLogs(); mutateLogs();
closeAllConnections(); closeAllConnections();
setTimeout(() => activateSelected(), 2000); setTimeout(() => activateSelected(), 2000);
Notice.success("Refresh clash config", 1000); Notice.success(t("Profile Switched"), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err?.message || err.toString(), 4000); Notice.error(err?.message || err.toString(), 4000);
} finally { } finally {
@ -192,7 +192,7 @@ const ProfilePage = () => {
try { try {
await enhanceProfiles(); await enhanceProfiles();
mutateLogs(); mutateLogs();
Notice.success("Refresh clash config", 1000); Notice.success(t("Profile Reactivated"), 1000);
} catch (err: any) { } catch (err: any) {
Notice.error(err.message || err.toString(), 3000); Notice.error(err.message || err.toString(), 3000);
} }