From 55167e75af86e91cf508873ebe25b2bcfe1f3807 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Fri, 30 May 2025 23:59:42 +0800 Subject: [PATCH] feat: add mode descriptions for Rule, Global, and Direct modes in English and Chinese locales --- src/components/home/clash-mode-card.tsx | 20 ++++++++++---------- src/locales/en.json | 5 ++++- src/locales/zh.json | 5 ++++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/components/home/clash-mode-card.tsx b/src/components/home/clash-mode-card.tsx index 16687b0a..19881182 100644 --- a/src/components/home/clash-mode-card.tsx +++ b/src/components/home/clash-mode-card.tsx @@ -70,15 +70,15 @@ export const ClashModeCard = () => { }, "&::after": mode === currentMode ? { - content: '""', - position: "absolute", - bottom: -16, - left: "50%", - width: 2, - height: 16, - bgcolor: "primary.main", - transform: "translateX(-50%)", - } + content: '""', + position: "absolute", + bottom: -16, + left: "50%", + width: 2, + height: 16, + bgcolor: "primary.main", + transform: "translateX(-50%)", + } : {}, }); @@ -148,7 +148,7 @@ export const ClashModeCard = () => { component="div" sx={descriptionStyles} > - {t(`${currentMode} Mode Description`)} + {t(`${currentMode?.charAt(0).toUpperCase()}${currentMode?.slice(1)} Mode Description`)} diff --git a/src/locales/en.json b/src/locales/en.json index 2ace044e..1958635e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -418,8 +418,11 @@ "Open Dir": "Open Dir", "More": "More", "Rule Mode": "Rule Mode", + "Rule Mode Description": "Rule Mode: Proxy connections based on rules", "Global Mode": "Global Mode", + "Global Mode Description": "Global Mode: All connections are proxied", "Direct Mode": "Direct Mode", + "Direct Mode Description": "Direct Mode: All connections are direct", "Enable Tray Speed": "Enable Tray Speed", "Enable Tray Icon": "Enable Tray Icon", "LightWeight Mode": "Lightweight Mode", @@ -567,4 +570,4 @@ "Failed to save settings": "Failed to save settings", "TCP Concurrency": "TCP Concurrency", "TCP ConcurrencyWhen accessing a web page, DNS resolution generally results in multiple IP addresses.": "TCP ConcurrencyWhen accessing a web page, DNS resolution generally results in multiple IP addresses." -} \ No newline at end of file +} diff --git a/src/locales/zh.json b/src/locales/zh.json index 2124c418..393cc61e 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -418,8 +418,11 @@ "Open Dir": "打开目录", "More": "更多", "Rule Mode": "规则模式", + "Rule Mode Description": "选择代理模式,规则模式会根据配置文件中的规则进行代理", "Global Mode": "全局模式", + "Global Mode Description": "全局模式会将所有流量通过代理", "Direct Mode": "直连模式", + "Direct Mode Description": "直连模式会直接连接到目标地址,不经过代理", "Enable Tray Speed": "启用托盘速率", "Enable Tray Icon": "启用托盘图标", "LightWeight Mode": "轻量模式", @@ -567,4 +570,4 @@ "Failed to save settings": "端口设置失败", "TCP Concurrency": "TCP并发", "TCP ConcurrencyWhen accessing a web page, DNS resolution generally results in multiple IP addresses.": "TCP 并发性当访问网页时,DNS 解析通常会产生多个 IP 地址。" -} \ No newline at end of file +}