Merge pull request #316 from Wangrui-i/master

修复端口被占用的提示没有翻译的问题;软件首次启动提示 增加翻译(翻译为当前系统语言)
This commit is contained in:
AmazingDM
2020-07-17 10:15:55 +08:00
committed by GitHub
5 changed files with 10 additions and 9 deletions

View File

@@ -41,21 +41,21 @@ namespace Netch.Forms
#region
if (PortHelper.PortInUse(Global.Settings.Socks5LocalPort))
{
MessageBoxX.Show("The Socks5 port is in use. Click OK to modify it.");
MessageBoxX.Show(i18N.Translate("The Socks5 port is in use. Click OK to modify it."));
SettingsButton.PerformClick();
return;
}
if (PortHelper.PortInUse(Global.Settings.HTTPLocalPort))
{
MessageBoxX.Show("The HTTP port is in use. Click OK to modify it.");
MessageBoxX.Show(i18N.Translate("The HTTP port is in use. Click OK to modify it."));
SettingsButton.PerformClick();
return;
}
if (PortHelper.PortInUse(Global.Settings.RedirectorTCPPort, PortType.TCP))
{
MessageBoxX.Show("The RedirectorTCP port is in use. Click OK to modify it.");
MessageBoxX.Show(i18N.Translate("The RedirectorTCP port is in use. Click OK to modify it."));
SettingsButton.PerformClick();
return;
}

View File

@@ -401,19 +401,19 @@ namespace Netch.Forms
#region
if (PortHelper.PortInUse(Global.Settings.Socks5LocalPort))
{
MessageBoxX.Show("The Socks5 port is in use. Please reset.");
MessageBoxX.Show(i18N.Translate("The Socks5 port is in use. Please reset."));
return;
}
if (PortHelper.PortInUse(Global.Settings.HTTPLocalPort))
{
MessageBoxX.Show("The HTTP port is in use. Please reset.");
MessageBoxX.Show(i18N.Translate("The HTTP port is in use. Please reset."));
return;
}
if (PortHelper.PortInUse(Global.Settings.RedirectorTCPPort, PortType.TCP))
{
MessageBoxX.Show("The RedirectorTCP port is in use. Please reset.");
MessageBoxX.Show(i18N.Translate("The RedirectorTCP port is in use. Please reset."));
return;
}
#endregion

View File

@@ -3,6 +3,7 @@
"Information": "信息",
"Error": "错误",
"If this is your first time using this software,\n please check http://netch.org to install supports first,\n or the program may report errors.": "如果你是第一次使用本软件,\n请务必前往http://netch.org安装程序所需依赖\n否则程序将无法正常运行",
"Netch is already running": "Netch 已经在运行中",
"Netch is not compatible with your system.": "Netch 和你的系统不兼容",
"Current arch of Netch:": "当前 Netch 架构:",

View File

@@ -69,7 +69,8 @@ namespace Netch.Utils
else
{
// 弹出提示
MessageBoxX.Show("如果你是第一次使用本软件\n请务必前往http://netch.org 安装程序所需依赖,\n否则程序将无法正常运行", i18N.Translate("注意!"));
i18N.Load("System");
MessageBoxX.Show(i18N.Translate("If this is your first time using this software,\n please check http://netch.org to install supports first,\n or the program may report errors."));
// 创建 data 文件夹并保存默认设置
Save();

View File

@@ -34,8 +34,6 @@ namespace Netch.Utils
langCode = CultureInfo.CurrentCulture.Name;
}
if (langCode == "zh-CN")
{
// 尝试加载内置中文语言
@@ -73,6 +71,7 @@ namespace Netch.Utils
{
return Data.Contains(text) ? Data[text].ToString() : text;
}
public static string Translate(params string[] text)
{
var a = new StringBuilder();