From e9432471504e3bcb468aac2a35c9118803c2d818 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sat, 20 Dec 2014 18:19:43 +0800 Subject: [PATCH] update texts --- shadowsocks-csharp/Data/cn.txt | 5 ++++- shadowsocks-csharp/Model/Configuration.cs | 11 ++++++----- shadowsocks-csharp/Model/Server.cs | 5 +++++ shadowsocks-csharp/View/ConfigForm.cs | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/shadowsocks-csharp/Data/cn.txt b/shadowsocks-csharp/Data/cn.txt index 0e2cc5e5..ba18053c 100644 --- a/shadowsocks-csharp/Data/cn.txt +++ b/shadowsocks-csharp/Data/cn.txt @@ -24,12 +24,15 @@ Proxy Port=代理端口 Remarks=备注 OK=确定 Cancel=取消 -New server=新服务器 +New server=未配置的服务器 QRCode=二维码 Shadowsocks Error: {0}=Shadowsocks 错误: {0} Port is already used=端口已被占用 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=端口超出范围 Shadowsocks {0} Update Found=Shadowsocks {0} 更新 Click here to download=点击这里下载 Shadowsocks is here=Shadowsocks 在这里 diff --git a/shadowsocks-csharp/Model/Configuration.cs b/shadowsocks-csharp/Model/Configuration.cs index 66dbcb4c..c2ee6ab5 100755 --- a/shadowsocks-csharp/Model/Configuration.cs +++ b/shadowsocks-csharp/Model/Configuration.cs @@ -1,4 +1,5 @@ -using System; +using Shadowsocks.Controller; +using System; using System.Collections.Generic; using System.IO; using System.Text; @@ -109,7 +110,7 @@ namespace Shadowsocks.Model { if (!condition) { - throw new Exception("assertion failure"); + throw new Exception(I18N.GetString("assertion failure")); } } @@ -117,7 +118,7 @@ namespace Shadowsocks.Model { if (port <= 0 || port > 65535) { - throw new ArgumentException("port out of range"); + throw new ArgumentException(I18N.GetString("Port out of range")); } } @@ -125,7 +126,7 @@ namespace Shadowsocks.Model { if (string.IsNullOrEmpty(password)) { - throw new ArgumentException("password can not be blank"); + throw new ArgumentException(I18N.GetString("Password can not be blank")); } } @@ -133,7 +134,7 @@ namespace Shadowsocks.Model { if (string.IsNullOrEmpty(server)) { - throw new ArgumentException("server IP can not be blank"); + throw new ArgumentException(I18N.GetString("Server IP can not be blank")); } } diff --git a/shadowsocks-csharp/Model/Server.cs b/shadowsocks-csharp/Model/Server.cs index ddc3602d..a8d03dda 100755 --- a/shadowsocks-csharp/Model/Server.cs +++ b/shadowsocks-csharp/Model/Server.cs @@ -4,6 +4,7 @@ using System.Text; using System.IO; using System.Diagnostics; using SimpleJson; +using Shadowsocks.Controller; namespace Shadowsocks.Model { @@ -21,6 +22,10 @@ namespace Shadowsocks.Model { get { + if (string.IsNullOrEmpty(server)) + { + return I18N.GetString("New server"); + } return string.IsNullOrEmpty(remarks) ? server + ":" + server_port : server + ":" + server_port + " (" + remarks + ")"; } } diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index 77281160..e58702cf 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -119,7 +119,7 @@ namespace Shadowsocks.View ServersListBox.Items.Clear(); foreach (Server server in _modifiedConfiguration.configs) { - ServersListBox.Items.Add(string.IsNullOrEmpty(server.server) ? I18N.GetString("New server") : server.FriendlyName); + ServersListBox.Items.Add(server.FriendlyName); } }