diff --git a/shadowsocks-csharp/Data/i18n.csv b/shadowsocks-csharp/Data/i18n.csv index f2bf8a29..3b50567f 100644 --- a/shadowsocks-csharp/Data/i18n.csv +++ b/shadowsocks-csharp/Data/i18n.csv @@ -76,6 +76,7 @@ New server,Новый сервер,未配置的服务器,新伺服器,新規サ Move &Up,Выше,上移(&U),上移 (&U),上に移動 (&U) Move D&own,Ниже,下移(&O),下移 (&O),下に移動 (&O) deprecated,Устаревшее,不推荐,不推薦,非推奨 +"Encryption method {0} not exist, will replace with {1}",,"加密方法{0}不存在,将使用{1}代替",, ,,,, #Statistics Config,,,, ,,,, diff --git a/shadowsocks-csharp/View/ConfigForm.cs b/shadowsocks-csharp/View/ConfigForm.cs index caab2f6d..68fc3a7d 100755 --- a/shadowsocks-csharp/View/ConfigForm.cs +++ b/shadowsocks-csharp/View/ConfigForm.cs @@ -79,7 +79,14 @@ namespace Shadowsocks.View public static EncryptionMethod GetMethod(string name) { if (!init) Init(); - return methodByName[name]; + bool success = methodByName.TryGetValue(name, out EncryptionMethod method); + if (!success) + { + string defaultMethod = Server.DefaultMethod; + MessageBox.Show(I18N.GetString("Encryption method {0} not exist, will replace with {1}", name, defaultMethod), I18N.GetString("Shadowsocks")); + return methodByName[defaultMethod]; + } + return method; } private EncryptionMethod(string name, bool deprecated)