diff --git a/Netch/Forms/MainForm.Control.cs b/Netch/Forms/MainForm.Control.cs index 186da23a..a069bcba 100644 --- a/Netch/Forms/MainForm.Control.cs +++ b/Netch/Forms/MainForm.Control.cs @@ -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; } diff --git a/Netch/Forms/SettingForm.cs b/Netch/Forms/SettingForm.cs index fcd5a85a..82607e29 100644 --- a/Netch/Forms/SettingForm.cs +++ b/Netch/Forms/SettingForm.cs @@ -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 diff --git a/Netch/Resources/zh-CN b/Netch/Resources/zh-CN index 7627f31f..6c85d3b7 100644 --- a/Netch/Resources/zh-CN +++ b/Netch/Resources/zh-CN @@ -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 架构:", diff --git a/Netch/Utils/Configuration.cs b/Netch/Utils/Configuration.cs index c692470d..9ba6514e 100644 --- a/Netch/Utils/Configuration.cs +++ b/Netch/Utils/Configuration.cs @@ -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(); diff --git a/Netch/Utils/i18N.cs b/Netch/Utils/i18N.cs index ff828137..54dac9bc 100644 --- a/Netch/Utils/i18N.cs +++ b/Netch/Utils/i18N.cs @@ -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();