From da234ef8578cdf6e38b3a03f322f8c6e481ef09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Tue, 6 Sep 2016 11:39:05 +0800 Subject: [PATCH] add Traditional Chinese (#698) * add Traditional Chinese * fix a resource type * fix the Traditional Chinese name of "address", "port", "screen", "Open Location" --- shadowsocks-csharp/Controller/I18N.cs | 39 ++++-- shadowsocks-csharp/Data/zh_tw.txt | 118 ++++++++++++++++++ .../Properties/Resources.Designer.cs | 13 ++ shadowsocks-csharp/Properties/Resources.resx | 3 + shadowsocks-csharp/shadowsocks-csharp.csproj | 1 + 5 files changed, 161 insertions(+), 13 deletions(-) create mode 100644 shadowsocks-csharp/Data/zh_tw.txt diff --git a/shadowsocks-csharp/Controller/I18N.cs b/shadowsocks-csharp/Controller/I18N.cs index 85f3ae60..6fd0ba0f 100755 --- a/shadowsocks-csharp/Controller/I18N.cs +++ b/shadowsocks-csharp/Controller/I18N.cs @@ -10,24 +10,37 @@ namespace Shadowsocks.Controller public class I18N { protected static Dictionary Strings; + + static void Init(string res) + { + using (var sr = new StringReader(res)) + { + foreach (var line in sr.NonWhiteSpaceLines()) + { + if (line[0] == '#') + continue; + + var pos = line.IndexOf('='); + if (pos < 1) + continue; + Strings[line.Substring(0, pos)] = line.Substring(pos + 1); + } + } + } + static I18N() { Strings = new Dictionary(); - - if (CultureInfo.CurrentCulture.IetfLanguageTag.StartsWith("zh", StringComparison.OrdinalIgnoreCase)) + string name = CultureInfo.CurrentCulture.Name; + if (name.StartsWith("zh")) { - using (var sr = new StringReader(Resources.cn)) + if (name == "zh" || name == "zh-CN") { - foreach (var line in sr.NonWhiteSpaceLines()) - { - if (line[0] == '#') - continue; - - var pos = line.IndexOf('='); - if (pos < 1) - continue; - Strings[line.Substring(0, pos)] = line.Substring(pos + 1); - } + Init(Resources.cn); + } + else + { + Init(Resources.zh_tw); } } } diff --git a/shadowsocks-csharp/Data/zh_tw.txt b/shadowsocks-csharp/Data/zh_tw.txt new file mode 100644 index 00000000..6d9f6b44 --- /dev/null +++ b/shadowsocks-csharp/Data/zh_tw.txt @@ -0,0 +1,118 @@ +# translation for Traditional Chinese + +Shadowsocks=Shadowsocks + +# Menu items + +Enable System Proxy=啟用系統代理 +Mode=系統代理模式 +PAC=PAC 模式 +Global=全局模式 +Servers=伺服器 +Edit Servers...=編輯伺服器... +Statistics Config...=統計配置... +Start on Boot=開機啟動 +SOCKS5 Proxy...=SOCKS5代理設置... +Allow Clients from LAN=允許來自局域網的連接 +Local PAC=使用本地 PAC +Online PAC=使用在線 PAC +Edit Local PAC File...=編輯本地 PAC 文件... +Update Local PAC from GFWList=從 GFWList 更新本地 PAC +Edit User Rule for GFWList...=編輯 GFWList 的用戶規則... +Show QRCode...=顯示二維碼... +Scan QRCode from Screen...=掃描螢幕上的二維碼... +Availability Statistics=統計可用性 +Show Logs...=顯示日誌... +Verbose Logging=詳細記錄日誌 +Updates...=更新... +Check for Updates...=檢查更新 +Check for Updates at Startup=啟動時檢查更新 +About...=關於... +Quit=退出 +Edit Servers=編輯伺服器 +Load Balance=負載均衡 +High Availability=高可用 +Choose by statistics=根據統計 + +# Config Form + +&Add=添加(&A) +&Delete=刪除(&D) +Server=伺服器 +Server Addr=伺服器位址 +Server Port=伺服器連接埠 +Password=密碼 +Encryption=加密 +Proxy Port=代理連接埠 +Remarks=備註 +Onetime Authentication=壹次性認證 +OK=確定 +Cancel=取消 +New server=未配置的伺服器 +Move &Up=上移(&U) +Move D&own=下移(&O) + +# Proxy Form + +Edit Proxy=代理設置 +Use Proxy=使用代理 +Proxy Addr=代理位址 +Proxy Port=代理連接埠 + +# Log Form + +&File=文件(&F) +&Open Location=在資料總管中打開(&O) +E&xit=退出(&X) +&View=視圖(&V) +&Clean Logs=清空日誌(&C) +Change &Font=設置字體(&F) +&Wrap Text=自動換行(&W) +&Top Most=置頂(&T) +&Show Toolbar=顯示工具欄(&S) +Log Viewer=日誌查看器 +Inbound=入站 +Outbound=出站 + +# QRCode Form + +QRCode=二維碼 + +# PAC Url Form + +Edit Online PAC URL=編輯在線 PAC 網址 +Edit Online PAC URL...=編輯在線 PAC 網址... +Please input PAC Url=請輸入 PAC 網址 + +# Messages + +Shadowsocks Error: {0}=Shadowsocks 錯誤: {0} +Port already in use=連接埠已被占用 +Illegal port number format=非法連接埠格式 +Please add at least one server=請添加至少壹個伺服器 +Server IP can not be blank=伺服器 IP 不能為空 +Password can not be blank=密碼不能為空 +Port out of range=連接埠超出範圍 +Port can't be 8123=連接埠不能為 8123 +Shadowsocks {0} Update Found=Shadowsocks {0} 更新 +No update is available=沒有可用的更新 +Click here to update=點擊這裏升級 +Shadowsocks is here=Shadowsocks 在這裏 +You can turn on/off Shadowsocks in the context menu=可以在右鍵菜單中開關 Shadowsocks +System Proxy Enabled=系統代理已啟用 +System Proxy Disabled=系統代理未啟用 +Failed to update PAC file =更新 PAC 文件失敗 +PAC updated=更新 PAC 成功 +No updates found. Please report to GFWList if you have problems with it.=未發現更新。如有問題請提交給 GFWList。 +No QRCode found. Try to zoom in or move it to the center of the screen.=未發現二維碼,嘗試把它放大或移動到靠近屏幕中間的位置 +Shadowsocks is already running.=Shadowsocks 已經在運行。 +Find Shadowsocks icon in your notify tray.=請在任務欄裏尋找 Shadowsocks 圖標。 +If you want to start multiple Shadowsocks, make a copy in another directory.=如果想同時啟動多個,可以另外復制壹份到別的目錄。 +Failed to decode QRCode=無法解析二維碼 +Failed to update registry=無法修改註冊表 +System Proxy On: =系統代理已啟用: +Running: Port {0}=正在運行:連接埠 {0} +Unexpected error, shadowsocks will exit. Please report to=非預期錯誤,Shadowsocks將退出。請提交此錯誤到 +Unsupported operating system, use Windows Vista at least.=不支持的操作系統版本,最低需求為Windows Vista。 +Proxy request failed=代理請求失敗 +Proxy handshake failed=代理握手失敗 diff --git a/shadowsocks-csharp/Properties/Resources.Designer.cs b/shadowsocks-csharp/Properties/Resources.Designer.cs index 49e2151b..7ae85e95 100644 --- a/shadowsocks-csharp/Properties/Resources.Designer.cs +++ b/shadowsocks-csharp/Properties/Resources.Designer.cs @@ -100,6 +100,19 @@ namespace Shadowsocks.Properties { } } + /// + /// Looks up a localized string similar to # translation for Traditional Chinese + /// + ///Shadowsocks=Shadowsocks + /// + ///# Menu items + /// + internal static string zh_tw { + get { + return ResourceManager.GetString("zh_tw", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/shadowsocks-csharp/Properties/Resources.resx b/shadowsocks-csharp/Properties/Resources.resx index 12e04f8d..5e4ca247 100755 --- a/shadowsocks-csharp/Properties/Resources.resx +++ b/shadowsocks-csharp/Properties/Resources.resx @@ -160,4 +160,7 @@ ..\data\user-rule.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\Data\zh_tw.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + \ No newline at end of file diff --git a/shadowsocks-csharp/shadowsocks-csharp.csproj b/shadowsocks-csharp/shadowsocks-csharp.csproj index a9d6cbc3..ba6cbec5 100644 --- a/shadowsocks-csharp/shadowsocks-csharp.csproj +++ b/shadowsocks-csharp/shadowsocks-csharp.csproj @@ -271,6 +271,7 @@ + Designer