Browse Source

show message when cipher not exist

tags/4.1.9.3
Student Main 4 years ago
parent
commit
25bbd90f17
2 changed files with 9 additions and 1 deletions
  1. +1
    -0
      shadowsocks-csharp/Data/i18n.csv
  2. +8
    -1
      shadowsocks-csharp/View/ConfigForm.cs

+ 1
- 0
shadowsocks-csharp/Data/i18n.csv View File

@@ -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,,,,
,,,,


+ 8
- 1
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -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)


Loading…
Cancel
Save