Skip to content

Commit ad253c5

Browse files
author
Simple-Tracker
committed
Improve i18n
1 parent 06fb1fa commit ad253c5

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

getproxy_common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func GetProxy(r *http.Request) (*url.URL, error) {
2222
getproxy_httpProxyURL.Scheme = "http"
2323
}
2424

25-
Log("GetProxy", "发现 HTTP 代理: %s (来源: %s)", true, getproxy_httpProxyURL.String(), httpProxy.Src())
25+
Log("GetProxy", GetLangText("GetProxy_ProxyFound"), true, "HTTP", getproxy_httpProxyURL.String(), httpProxy.Src())
2626
}
2727

2828
httpsProxy := proxyProvider.GetHTTPSProxy("")
@@ -32,11 +32,11 @@ func GetProxy(r *http.Request) (*url.URL, error) {
3232
getproxy_httpsProxyURL.Scheme = "http"
3333
}
3434

35-
Log("GetProxy", "发现 HTTPS 代理: %s (来源: %s)", true, getproxy_httpsProxyURL.String(), httpsProxy.Src())
35+
Log("GetProxy", GetLangText("GetProxy_ProxyFound"), true, "HTTPS", getproxy_httpsProxyURL.String(), httpsProxy.Src())
3636
}
3737

3838
if getproxy_httpProxyURL == nil || getproxy_httpsProxyURL == nil {
39-
Log("GetProxy", "未能发现 HTTP/HTTPS 代理", true)
39+
Log("GetProxy", GetLangText("GetProxy_ProxyNotFound"), true, "HTTP/HTTPS")
4040
}
4141
} else if r != nil {
4242
if r.URL.Scheme == "https" {

getproxy_other.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func GetProxy(r *http.Request) (*url.URL, error) {
1313
if r == nil {
1414
if !getproxy_notified {
1515
getproxy_notified = true
16-
Log("GetProxy", "当前平台通过环境变量设置代理, 若要使用, 请确保已正确设置环境变量", true)
16+
Log("GetProxy", GetLangText("GetProxy_UseEnvVar"), true)
1717
}
1818
return nil, nil
1919
}

i18n.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ var defaultLangContent = map[string]string{
3737
"CheckUpdate-Ignore_UnknownVersion": "跳过自动检查更新: 未知版本",
3838
"CheckUpdate-Ignore_NightlyVersion": "跳过自动检查更新: 夜间构建版本",
3939
"CheckUpdate-Ignore_BadVersion": "跳过自动检查更新: 错误版本 %s",
40+
"GetProxy_ProxyFound": "发现 %s 代理: %s (来源: %s)",
41+
"GetProxy_ProxyNotFound": "未能发现 %s 代理",
42+
"GetProxy_UseEnvVar": "当前平台通过环境变量设置代理, 若要使用, 请确保已正确设置环境变量",
4043
"ClientQB_Detect-OldClientURL": "检测到 ClientURL (Web UI), 已自动修改至 ClientURL (Web API): %s",
4144
"Debug-LoadConfig_HotReload": "发现配置文件 (%s) 更改, 正在进行热重载",
4245
"Debug-SetBlockListFromFile_HotReload": "发现 BlockListFile (%s) 更改, 正在进行热重载",

lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"CheckUpdate-Ignore_UnknownVersion": "Skip auto check update: Unknwon version",
2727
"CheckUpdate-Ignore_NightlyVersion": "Skip auto check update: Nightly version",
2828
"CheckUpdate-Ignore_BadVersion": "Skip auto check update: Error version %s",
29+
"GetProxy_ProxyFound": "%s proxy found: %s (Source: %s)",
30+
"GetProxy_ProxyNotFound": "%s proxy not found",
31+
"GetProxy_UseEnvVar": "The current platform sets the proxy through environment variables. If you want to use it, please make sure that the environment variables are set correctly",
2932
"ClientQB_Detect-OldClientURL": "Detected ClientURL (Web UI), automatically changed to ClientURL (Web API): %s",
3033
"Debug-LoadConfig_HotReload": "Config (%s) change found, hot reload in progress",
3134
"Debug-SetBlockListFromFile_HotReload": "BlockListFile (%s) change found, hot reload in progress",

0 commit comments

Comments
 (0)