@@ -9,7 +9,6 @@ using System.Windows.Forms; | |||||
namespace Shadowsocks.Controller | namespace Shadowsocks.Controller | ||||
{ | { | ||||
public static class I18N | public static class I18N | ||||
{ | { | ||||
public const string I18N_FILE = "i18n.csv"; | public const string I18N_FILE = "i18n.csv"; | ||||
@@ -76,18 +75,8 @@ namespace Shadowsocks.Controller | |||||
static I18N() | static I18N() | ||||
{ | { | ||||
string i18n; | |||||
string locale = CultureInfo.CurrentCulture.Name; | string locale = CultureInfo.CurrentCulture.Name; | ||||
if (!File.Exists(I18N_FILE)) | |||||
{ | |||||
i18n = Resources.i18n_csv; | |||||
//File.WriteAllText(I18N_FILE, i18n, Encoding.UTF8); | |||||
} | |||||
else | |||||
{ | |||||
Logging.Info("Using external translation"); | |||||
i18n = File.ReadAllText(I18N_FILE, Encoding.UTF8); | |||||
} | |||||
string i18n = File.ReadAllText(Utils.GetDataPath(I18N_FILE), Encoding.UTF8); | |||||
Logging.Info("Current language is: " + locale); | Logging.Info("Current language is: " + locale); | ||||
Init(i18n, locale); | Init(i18n, locale); | ||||
} | } | ||||
@@ -114,32 +114,6 @@ namespace Shadowsocks.Properties { | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 查找类似 en,zh-CN,zh-TW,ja | |||||
///#Restart program to apply translation,,, | |||||
///#This is comment line,,, | |||||
///#Always keep language name at head of file,,, | |||||
///#Language name is output in log,,, | |||||
///"#You can find it by search ""Current language is:""",,, | |||||
///#Please use UTF-8 with BOM encoding so we can edit it in Excel,,, | |||||
///,,, | |||||
///Shadowsocks,Shadowsocks,Shadowsocks,Shadowsocks | |||||
///,,, | |||||
///#Menu,,, | |||||
///,,, | |||||
///System Proxy,系统代理,系統代理,システムプロキシ | |||||
///Disable,禁用,禁用,無効 | |||||
///PAC,PAC 模式,PAC 模式,PAC | |||||
///Global,全局模式,全局模式,全般 | |||||
///Servers,服务器,伺服器,サーバー | |||||
///Edit Servers...,编辑服务器...,編 [字符串的其余部分被截断]"; 的本地化字符串。 | |||||
/// </summary> | |||||
internal static string i18n_csv { | |||||
get { | |||||
return ResourceManager.GetString("i18n_csv", resourceCulture); | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 查找 System.Byte[] 类型的本地化资源。 | /// 查找 System.Byte[] 类型的本地化资源。 | ||||
/// </summary> | /// </summary> | ||||
@@ -124,9 +124,6 @@ | |||||
<data name="default_abp_rule" type="System.Resources.ResXFileRef, System.Windows.Forms"> | <data name="default_abp_rule" type="System.Resources.ResXFileRef, System.Windows.Forms"> | ||||
<value>..\Data\default-abp-rule.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> | <value>..\Data\default-abp-rule.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> | ||||
</data> | </data> | ||||
<data name="i18n_csv" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||||
<value>..\Data\i18n.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> | |||||
</data> | |||||
<data name="libsscrypto" type="System.Resources.ResXFileRef, System.Windows.Forms"> | <data name="libsscrypto" type="System.Resources.ResXFileRef, System.Windows.Forms"> | ||||
<value>..\Data\libsscrypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | <value>..\Data\libsscrypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||||
</data> | </data> | ||||
@@ -320,7 +320,7 @@ namespace Shadowsocks.View | |||||
CreateMenuItem("Show Logs...", new EventHandler(this.ShowLogItem_Click)), | CreateMenuItem("Show Logs...", new EventHandler(this.ShowLogItem_Click)), | ||||
this.VerboseLoggingToggleItem = CreateMenuItem( "Verbose Logging", new EventHandler(this.VerboseLoggingToggleItem_Click) ), | this.VerboseLoggingToggleItem = CreateMenuItem( "Verbose Logging", new EventHandler(this.VerboseLoggingToggleItem_Click) ), | ||||
this.ShowPluginOutputToggleItem = CreateMenuItem("Show Plugin Output", new EventHandler(this.ShowPluginOutputToggleItem_Click)), | this.ShowPluginOutputToggleItem = CreateMenuItem("Show Plugin Output", new EventHandler(this.ShowPluginOutputToggleItem_Click)), | ||||
this.WriteI18NFileItem = CreateMenuItem("Write translation template",new EventHandler(WriteI18NFileItem_Click)), | |||||
//this.WriteI18NFileItem = CreateMenuItem("Write translation template",new EventHandler(WriteI18NFileItem_Click)), | |||||
CreateMenuGroup("Updates...", new MenuItem[] { | CreateMenuGroup("Updates...", new MenuItem[] { | ||||
CreateMenuItem("Check for Updates...", new EventHandler(this.checkUpdatesItem_Click)), | CreateMenuItem("Check for Updates...", new EventHandler(this.checkUpdatesItem_Click)), | ||||
new MenuItem("-"), | new MenuItem("-"), | ||||
@@ -717,11 +717,6 @@ namespace Shadowsocks.View | |||||
controller.ToggleShowPluginOutput(ShowPluginOutputToggleItem.Checked); | controller.ToggleShowPluginOutput(ShowPluginOutputToggleItem.Checked); | ||||
} | } | ||||
private void WriteI18NFileItem_Click(object sender, EventArgs e) | |||||
{ | |||||
File.WriteAllText(I18N.I18N_FILE, Resources.i18n_csv, Encoding.UTF8); | |||||
} | |||||
private void StatisticsConfigItem_Click(object sender, EventArgs e) | private void StatisticsConfigItem_Click(object sender, EventArgs e) | ||||
{ | { | ||||
StatisticsStrategyConfigurationForm form = new StatisticsStrategyConfigurationForm(controller); | StatisticsStrategyConfigurationForm form = new StatisticsStrategyConfigurationForm(controller); | ||||