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

View File

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

View File

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

View File

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

View File

@@ -53,7 +53,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
const onSave = useLockFn(async () => {
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;
}

View File

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