From ffac06c2798445ce0a67e32a6c3d1fe7d34fd6ed Mon Sep 17 00:00:00 2001 From: huiyadanli Date: Sun, 8 Apr 2018 21:00:12 +0800 Subject: [PATCH] [+] Add language zh-Hant --- PasteEx/App.config | 5 - PasteEx/FormMain.Designer.cs | 10 +- PasteEx/FormMain.resx | 308 ++--- PasteEx/FormMain.zh-Hant.resx | 139 +++ PasteEx/FormSetting.Designer.cs | 45 +- PasteEx/FormSetting.cs | 16 +- PasteEx/FormSetting.resx | 1056 ++++++++--------- PasteEx/FormSetting.zh-CN.resx | 78 -- PasteEx/FormSetting.zh-Hant.resx | 208 ++++ PasteEx/PasteEx.csproj | 24 +- PasteEx/Resources/Strings.Designer.cs | 2 +- PasteEx/Resources/Strings.resx | 2 +- PasteEx/Resources/Strings.zh-Hant.Designer.cs | 0 PasteEx/Resources/Strings.zh-Hant.resx | 213 ++++ PasteEx/Util/I18n.cs | 14 +- PasteEx/Util/UpdateRepairer.cs | 27 + 16 files changed, 1292 insertions(+), 855 deletions(-) create mode 100644 PasteEx/FormMain.zh-Hant.resx create mode 100644 PasteEx/FormSetting.zh-Hant.resx create mode 100644 PasteEx/Resources/Strings.zh-Hant.Designer.cs create mode 100644 PasteEx/Resources/Strings.zh-Hant.resx create mode 100644 PasteEx/Util/UpdateRepairer.cs diff --git a/PasteEx/App.config b/PasteEx/App.config index 9fe4f00..b0535d9 100644 --- a/PasteEx/App.config +++ b/PasteEx/App.config @@ -5,11 +5,6 @@
- - - - - diff --git a/PasteEx/FormMain.Designer.cs b/PasteEx/FormMain.Designer.cs index b43273b..fd9486d 100644 --- a/PasteEx/FormMain.Designer.cs +++ b/PasteEx/FormMain.Designer.cs @@ -29,7 +29,6 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); - this.Icon = Properties.Resources.ico; this.txtFileName = new System.Windows.Forms.TextBox(); this.cboExtension = new System.Windows.Forms.ComboBox(); this.lblExtension = new System.Windows.Forms.Label(); @@ -49,8 +48,8 @@ private void InitializeComponent() // // cboExtension // - this.cboExtension.FormattingEnabled = true; resources.ApplyResources(this.cboExtension, "cboExtension"); + this.cboExtension.FormattingEnabled = true; this.cboExtension.Name = "cboExtension"; this.cboExtension.SelectedIndexChanged += new System.EventHandler(this.cboExtension_SelectedIndexChanged); // @@ -66,18 +65,18 @@ private void InitializeComponent() // // statusStrip // + resources.ApplyResources(this.statusStrip, "statusStrip"); this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsslCurrentLocation}); - resources.ApplyResources(this.statusStrip, "statusStrip"); this.statusStrip.Name = "statusStrip"; this.statusStrip.ShowItemToolTips = true; this.statusStrip.SizingGrip = false; // // tsslCurrentLocation // + resources.ApplyResources(this.tsslCurrentLocation, "tsslCurrentLocation"); this.tsslCurrentLocation.AutoToolTip = true; this.tsslCurrentLocation.Name = "tsslCurrentLocation"; - resources.ApplyResources(this.tsslCurrentLocation, "tsslCurrentLocation"); // // btnSave // @@ -95,8 +94,8 @@ private void InitializeComponent() // // btnSettings // - this.btnSettings.BackgroundImage = global::PasteEx.Properties.Resources.setting; resources.ApplyResources(this.btnSettings, "btnSettings"); + this.btnSettings.BackgroundImage = global::PasteEx.Properties.Resources.setting; this.btnSettings.ForeColor = System.Drawing.SystemColors.ControlText; this.btnSettings.Name = "btnSettings"; this.btnSettings.UseVisualStyleBackColor = true; @@ -115,6 +114,7 @@ private void InitializeComponent() this.Controls.Add(this.cboExtension); this.Controls.Add(this.txtFileName); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = global::PasteEx.Properties.Resources.ico; this.KeyPreview = true; this.MaximizeBox = false; this.Name = "FormMain"; diff --git a/PasteEx/FormMain.resx b/PasteEx/FormMain.resx index 3210ff6..6377005 100644 --- a/PasteEx/FormMain.resx +++ b/PasteEx/FormMain.resx @@ -117,49 +117,40 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 25, 21 + + PasteEx - - 174, 21 + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 2 - - - txtFileName - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - - $this + + 9 - - 7 + + lblExtension + 214, 21 - - 58, 20 - - - 3 + + $this - - cboExtension + + lblFileName - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 214, 53 - - $this + + btnSettings - - 6 + + 27, 53 True @@ -168,202 +159,211 @@ NoControl - - 212, 6 - - - 65, 12 + + NoControl - - 8 + + 6, 12 - - Extension: + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - lblExtension + + statusStrip - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - + $this - - 4 + + CenterScreen - - True + + 11 + + + tsslCurrentLocation + + + 169, 53 + + + 137, 23 + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 58, 20 NoControl - - 23, 6 + + 25, 21 - - 65, 12 + + 301, 22 - - 7 + + 4 - - File Name: + + Extension: - - lblFileName + + 212, 6 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + txtFileName - - $this + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 5 + + $this - - 17, 17 - 0, 85 - - 301, 22 + + 8 - - 9 + + 23, 6 - - statusStrip1 + + Save - - statusStrip + + 7 - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + btnChooseLocation - - $this + + 6 - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 3 104, 17 - - Current Location + + 23, 23 + + + 7 NoControl - - 214, 53 - - - 58, 23 - - - 0 + + 5 - - Save + + 1 - - btnSave + + 3 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 2 - - - NoControl + + $this - - 27, 53 + + 174, 21 - - 137, 23 + + Zoom - - 1 + + $this Choose Location - - btnChooseLocation + + 2 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + cboExtension - - 1 + + True - - Zoom + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + NoControl - - 169, 53 - - - 23, 23 - - - 11 - - - btnSettings + + 0 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + Current Location - - 0 + + btnSave - - True - - - 6, 12 + + 65, 12 - - 301, 107 + + 65, 12 - - NoControl + + 58, 23 - - CenterScreen + + File Name: - - PasteEx + + 2 - - tsslCurrentLocation + + $this - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 301, 107 FormMain - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + statusStrip1 + + + zh-Hant + + + True + + + 17, 17 + \ No newline at end of file diff --git a/PasteEx/FormMain.zh-Hant.resx b/PasteEx/FormMain.zh-Hant.resx new file mode 100644 index 0000000..d6083e0 --- /dev/null +++ b/PasteEx/FormMain.zh-Hant.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 47, 12 + + + 47, 12 + + + 副檔名: + + + 資料名: + + + 保存 + + + 選擇路徑 + + \ No newline at end of file diff --git a/PasteEx/FormSetting.Designer.cs b/PasteEx/FormSetting.Designer.cs index c5c24a2..0576112 100644 --- a/PasteEx/FormSetting.Designer.cs +++ b/PasteEx/FormSetting.Designer.cs @@ -30,7 +30,6 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSetting)); - this.Icon = Properties.Resources.ico; this.tipHelp = new System.Windows.Forms.ToolTip(this.components); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageNomal = new System.Windows.Forms.TabPage(); @@ -79,25 +78,23 @@ private void InitializeComponent() // // tabControl1 // - resources.ApplyResources(this.tabControl1, "tabControl1"); this.tabControl1.Controls.Add(this.tabPageNomal); this.tabControl1.Controls.Add(this.tabPageCustom); this.tabControl1.Controls.Add(this.tabPageAbout); + resources.ApplyResources(this.tabControl1, "tabControl1"); this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; - this.tipHelp.SetToolTip(this.tabControl1, resources.GetString("tabControl1.ToolTip")); this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); // // tabPageNomal // - resources.ApplyResources(this.tabPageNomal, "tabPageNomal"); this.tabPageNomal.Controls.Add(this.groupBox4); this.tabPageNomal.Controls.Add(this.groupBox3); this.tabPageNomal.Controls.Add(this.groupBox1); + resources.ApplyResources(this.tabPageNomal, "tabPageNomal"); this.tabPageNomal.Name = "tabPageNomal"; - this.tipHelp.SetToolTip(this.tabPageNomal, resources.GetString("tabPageNomal.ToolTip")); this.tabPageNomal.UseVisualStyleBackColor = true; // // groupBox4 @@ -107,25 +104,23 @@ private void InitializeComponent() this.groupBox4.Controls.Add(this.labelLanguage); this.groupBox4.Name = "groupBox4"; this.groupBox4.TabStop = false; - this.tipHelp.SetToolTip(this.groupBox4, resources.GetString("groupBox4.ToolTip")); // // cboLanguage // - resources.ApplyResources(this.cboLanguage, "cboLanguage"); this.cboLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboLanguage.FormattingEnabled = true; this.cboLanguage.Items.AddRange(new object[] { resources.GetString("cboLanguage.Items"), - resources.GetString("cboLanguage.Items1")}); + resources.GetString("cboLanguage.Items1"), + resources.GetString("cboLanguage.Items2")}); + resources.ApplyResources(this.cboLanguage, "cboLanguage"); this.cboLanguage.Name = "cboLanguage"; - this.tipHelp.SetToolTip(this.cboLanguage, resources.GetString("cboLanguage.ToolTip")); this.cboLanguage.SelectedIndexChanged += new System.EventHandler(this.cboLanguage_SelectedIndexChanged); // // labelLanguage // resources.ApplyResources(this.labelLanguage, "labelLanguage"); this.labelLanguage.Name = "labelLanguage"; - this.tipHelp.SetToolTip(this.labelLanguage, resources.GetString("labelLanguage.ToolTip")); // // groupBox3 // @@ -135,20 +130,17 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.btnFastRegister); this.groupBox3.Name = "groupBox3"; this.groupBox3.TabStop = false; - this.tipHelp.SetToolTip(this.groupBox3, resources.GetString("groupBox3.ToolTip")); // // chkFastNeedShiftKey // resources.ApplyResources(this.chkFastNeedShiftKey, "chkFastNeedShiftKey"); this.chkFastNeedShiftKey.Name = "chkFastNeedShiftKey"; - this.tipHelp.SetToolTip(this.chkFastNeedShiftKey, resources.GetString("chkFastNeedShiftKey.ToolTip")); this.chkFastNeedShiftKey.UseVisualStyleBackColor = true; // // btnFastUnRegister // resources.ApplyResources(this.btnFastUnRegister, "btnFastUnRegister"); this.btnFastUnRegister.Name = "btnFastUnRegister"; - this.tipHelp.SetToolTip(this.btnFastUnRegister, resources.GetString("btnFastUnRegister.ToolTip")); this.btnFastUnRegister.UseVisualStyleBackColor = true; this.btnFastUnRegister.Click += new System.EventHandler(this.btnFastUnRegister_Click); // @@ -156,7 +148,6 @@ private void InitializeComponent() // resources.ApplyResources(this.btnFastRegister, "btnFastRegister"); this.btnFastRegister.Name = "btnFastRegister"; - this.tipHelp.SetToolTip(this.btnFastRegister, resources.GetString("btnFastRegister.ToolTip")); this.btnFastRegister.UseVisualStyleBackColor = true; this.btnFastRegister.Click += new System.EventHandler(this.btnFastRegister_Click); // @@ -168,20 +159,17 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.btnRegister); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; - this.tipHelp.SetToolTip(this.groupBox1, resources.GetString("groupBox1.ToolTip")); // // chkNeedShiftKey // resources.ApplyResources(this.chkNeedShiftKey, "chkNeedShiftKey"); this.chkNeedShiftKey.Name = "chkNeedShiftKey"; - this.tipHelp.SetToolTip(this.chkNeedShiftKey, resources.GetString("chkNeedShiftKey.ToolTip")); this.chkNeedShiftKey.UseVisualStyleBackColor = true; // // btnUnRegister // resources.ApplyResources(this.btnUnRegister, "btnUnRegister"); this.btnUnRegister.Name = "btnUnRegister"; - this.tipHelp.SetToolTip(this.btnUnRegister, resources.GetString("btnUnRegister.ToolTip")); this.btnUnRegister.UseVisualStyleBackColor = true; this.btnUnRegister.Click += new System.EventHandler(this.btnUnRegister_Click); // @@ -189,16 +177,14 @@ private void InitializeComponent() // resources.ApplyResources(this.btnRegister, "btnRegister"); this.btnRegister.Name = "btnRegister"; - this.tipHelp.SetToolTip(this.btnRegister, resources.GetString("btnRegister.ToolTip")); this.btnRegister.UseVisualStyleBackColor = true; this.btnRegister.Click += new System.EventHandler(this.btnRegister_Click); // // tabPageCustom // - resources.ApplyResources(this.tabPageCustom, "tabPageCustom"); this.tabPageCustom.Controls.Add(this.groupBox2); + resources.ApplyResources(this.tabPageCustom, "tabPageCustom"); this.tabPageCustom.Name = "tabPageCustom"; - this.tipHelp.SetToolTip(this.tabPageCustom, resources.GetString("tabPageCustom.ToolTip")); this.tabPageCustom.UseVisualStyleBackColor = true; // // groupBox2 @@ -210,28 +196,24 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.chkAutoExtSwitch); this.groupBox2.Name = "groupBox2"; this.groupBox2.TabStop = false; - this.tipHelp.SetToolTip(this.groupBox2, resources.GetString("groupBox2.ToolTip")); // // lblTipError // resources.ApplyResources(this.lblTipError, "lblTipError"); this.lblTipError.ForeColor = System.Drawing.Color.Red; this.lblTipError.Name = "lblTipError"; - this.tipHelp.SetToolTip(this.lblTipError, resources.GetString("lblTipError.ToolTip")); // // lblHelp // resources.ApplyResources(this.lblHelp, "lblHelp"); this.lblHelp.Cursor = System.Windows.Forms.Cursors.Help; this.lblHelp.Name = "lblHelp"; - this.tipHelp.SetToolTip(this.lblHelp, resources.GetString("lblHelp.ToolTip")); this.lblHelp.MouseHover += new System.EventHandler(this.lblHelp_MouseHover); // // txtAutoExtRule // resources.ApplyResources(this.txtAutoExtRule, "txtAutoExtRule"); this.txtAutoExtRule.Name = "txtAutoExtRule"; - this.tipHelp.SetToolTip(this.txtAutoExtRule, resources.GetString("txtAutoExtRule.ToolTip")); this.txtAutoExtRule.TextChanged += new System.EventHandler(this.txtAutoExtRuleValidate); this.txtAutoExtRule.Leave += new System.EventHandler(this.txtAutoExtRuleValidate); this.txtAutoExtRule.MouseLeave += new System.EventHandler(this.txtAutoExtRuleValidate); @@ -240,44 +222,39 @@ private void InitializeComponent() // resources.ApplyResources(this.chkAutoExtSwitch, "chkAutoExtSwitch"); this.chkAutoExtSwitch.Name = "chkAutoExtSwitch"; - this.tipHelp.SetToolTip(this.chkAutoExtSwitch, resources.GetString("chkAutoExtSwitch.ToolTip")); this.chkAutoExtSwitch.UseVisualStyleBackColor = true; this.chkAutoExtSwitch.CheckedChanged += new System.EventHandler(this.chkAutoExtSwitch_CheckedChanged); // // tabPageAbout // - resources.ApplyResources(this.tabPageAbout, "tabPageAbout"); this.tabPageAbout.Controls.Add(this.labelUpdateinfo); this.tabPageAbout.Controls.Add(this.picLoading); this.tabPageAbout.Controls.Add(this.linkLabel1); this.tabPageAbout.Controls.Add(this.label2); this.tabPageAbout.Controls.Add(this.pictureBox1); + resources.ApplyResources(this.tabPageAbout, "tabPageAbout"); this.tabPageAbout.Name = "tabPageAbout"; - this.tipHelp.SetToolTip(this.tabPageAbout, resources.GetString("tabPageAbout.ToolTip")); this.tabPageAbout.UseVisualStyleBackColor = true; // // labelUpdateinfo // - resources.ApplyResources(this.labelUpdateinfo, "labelUpdateinfo"); this.labelUpdateinfo.ForeColor = System.Drawing.Color.Green; + resources.ApplyResources(this.labelUpdateinfo, "labelUpdateinfo"); this.labelUpdateinfo.LinkColor = System.Drawing.Color.Green; this.labelUpdateinfo.Name = "labelUpdateinfo"; - this.tipHelp.SetToolTip(this.labelUpdateinfo, resources.GetString("labelUpdateinfo.ToolTip")); this.labelUpdateinfo.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabels_LinkClicked); // // picLoading // - resources.ApplyResources(this.picLoading, "picLoading"); this.picLoading.Image = global::PasteEx.Properties.Resources.loading; + resources.ApplyResources(this.picLoading, "picLoading"); this.picLoading.Name = "picLoading"; this.picLoading.TabStop = false; - this.tipHelp.SetToolTip(this.picLoading, resources.GetString("picLoading.ToolTip")); // // linkLabel1 // resources.ApplyResources(this.linkLabel1, "linkLabel1"); this.linkLabel1.Name = "linkLabel1"; - this.tipHelp.SetToolTip(this.linkLabel1, resources.GetString("linkLabel1.ToolTip")); this.linkLabel1.UseCompatibleTextRendering = true; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabels_LinkClicked); // @@ -285,7 +262,6 @@ private void InitializeComponent() // resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; - this.tipHelp.SetToolTip(this.label2, resources.GetString("label2.ToolTip")); // // pictureBox1 // @@ -293,15 +269,14 @@ private void InitializeComponent() this.pictureBox1.Image = global::PasteEx.Properties.Resources.png; this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.TabStop = false; - this.tipHelp.SetToolTip(this.pictureBox1, resources.GetString("pictureBox1.ToolTip")); // // FormSetting // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.tabControl1); + this.Icon = global::PasteEx.Properties.Resources.ico; this.Name = "FormSetting"; - this.tipHelp.SetToolTip(this, resources.GetString("$this.ToolTip")); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormSetting_FormClosed); this.Load += new System.EventHandler(this.FormSetting_Load); this.tabControl1.ResumeLayout(false); diff --git a/PasteEx/FormSetting.cs b/PasteEx/FormSetting.cs index cbae31b..9969a5f 100644 --- a/PasteEx/FormSetting.cs +++ b/PasteEx/FormSetting.cs @@ -1,7 +1,6 @@ using PasteEx.Util; using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Threading.Tasks; using System.Windows.Forms; @@ -49,10 +48,16 @@ private void FormSetting_Load(object sender, EventArgs e) // About Tab Page linkLabel1.Text = String.Format(Resources.Strings.TxtAbout, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); - int index = I18n.FindLanguageByCurrentThreadInfo().Index; + string i = Properties.Settings.Default.language; + if (String.IsNullOrWhiteSpace(i)) + { + i = I18n.FindLanguageByCurrentThreadInfo().Index.ToString(); + } + + int index = Convert.ToInt32(i); cboLanguage.SelectedIndex = index; - // zh-CN - if (index == 1) + // zh-CN || zh-Hant + if (index == 1 || index == 2) { linkLabel1.Links.Add(28, 10, @"https://huiyadanli.github.io/"); linkLabel1.Links.Add(56, 6, @"https://github.com/huiyadanli/PasteEx/issues"); @@ -239,6 +244,9 @@ private void cboLanguage_SelectedIndexChanged(object sender, EventArgs e) if (language != preLanguage) { I18n.SetWinFormLanguage(I18n.FindLanguageByLocalName(language).CultureInfoName); + + // About Tab Page Reload + linkLabel1.Text = String.Format(Resources.Strings.TxtAbout, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); } } diff --git a/PasteEx/FormSetting.resx b/PasteEx/FormSetting.resx index eb83d96..8c14825 100644 --- a/PasteEx/FormSetting.resx +++ b/PasteEx/FormSetting.resx @@ -117,581 +117,614 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 266, 20 + + 17, 17 + + + + Top, Bottom, Left, Right - - 329, 215 + + English - - - 2 + + 简体中文 - - 328, 23 + + 繁體中文 - - 383, 289 + + + 86, 23 - - 6, 69 + + 121, 20 - - 11 + + + 1 - - How to use? + + cboLanguage + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + + groupBox4 - + 0 - - 60, 16 + + True - - 86, 23 + + 21, 26 - - 1 + + 59, 12 - - linkLabel1 + + 0 Language: - - Quick Paste As File Context Menu + + labelLanguage - - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 169, 241 + + groupBox4 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - + + 6, 132 + + 371, 57 - - + + 14 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Interface - - True + + groupBox4 - - Remove + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - It's the latest version + + tabPageNomal - - Text Extension Rules + + 0 - - 1 + + Top, Bottom, Left, Right - - chkNeedShiftKey + + True - - Interface + + NoControl - - 4 + + 23, 24 - - False + + 126, 16 - - 367, 275 + + 9 - - 371, 57 + + Shift Right Click - - 1 + + chkFastNeedShiftKey - - groupBox1 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 126, 16 + + groupBox3 - - + + 0 - - 391, 315 + + Top, Right - NoControl - - 1 + + 266, 20 - - tabPageCustom + + 86, 23 - - groupBox3 + + 8 - - 9 + + Remove - - groupBox4 + + btnFastUnRegister - - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True + + groupBox3 - - NoControl + + 1 - - System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Top, Right - - 86, 23 + + NoControl - - 135, 15 + + 174, 20 - - + + 86, 23 - - 2 + + 6 - - tabControl1 + + Add - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + btnFastRegister System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 6 + + groupBox3 - - Both + + 2 - - pictureBox1 + + 6, 69 - - 12 + + 371, 57 - - + + 13 - - 0 + + Quick Paste As File Context Menu - - Shift Right Click + + groupBox3 - - groupBox1 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabPageNomal - - 3 + + 1 - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Top, Bottom, Left, Right - - groupBox1 + + True - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl - - 59, 12 - - - Fill + + 23, 24 - - tabPageNomal + + 126, 16 - - + + 9 - - labelUpdateinfo + + Shift Right Click - - + + chkNeedShiftKey - - 4, 22 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 21, 26 + + groupBox1 - - 174, 20 + + 0 - - groupBox2 + + Top, Right - - About + + NoControl - - groupBox3 + + 266, 20 - - No + + 86, 23 - - 12 + + 8 - - + + Remove - - 16, 16 + + btnUnRegister - - tabControl1 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tabPageAbout + + groupBox1 - - 0 + + 1 - - 8 + + Top, Right - - General + + NoControl - - 1 + + 174, 20 - - 1 + + 86, 23 - - Top, Bottom, Left, Right + + 6 - - Top, Right + + Add - - groupBox3 + + btnRegister - - btnFastUnRegister + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tabPageAbout + + groupBox1 - - NoControl + + 2 - - 383, 289 + + 6, 6 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 371, 57 - - Top, Bottom, Left, Right + + 12 - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Context Menu - - True + + groupBox1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True + + tabPageNomal - - FormSetting + + 2 - - Top, Right + + 4, 22 - - + + 3, 3, 3, 3 - - True + + 383, 289 - + 1 - - 86, 23 + + General + + + tabPageNomal System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 23, 0 + + tabControl1 - - 23, 24 + + 0 Top, Bottom, Left, Right - - groupBox2 - - - + + True - - tabPageNomal + + NoControl - - + + 199, 21 - - 2 + + No - - groupBox4 + + 137, 12 - - 383, 289 + + 5 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + The rules is incorrect - - groupBox2 + + False - - 3 + + lblTipError - - AutoSize + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tabPageNomal + + groupBox2 - - tabControl1 + + 0 - - 100, 23 + + True - - tabPageAbout + + NoControl - - 17, 241 + + 100, 21 - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 71, 12 - - Top, Bottom, Left, Right + + 4 - - + + How to use? - - + + lblHelp - - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 7 + + groupBox2 - - labelLanguage + + 1 - - 126, 16 + + Top, Bottom, Left, Right - - 3 + + 22, 42 - - $this + + True - - tabPageAbout + + Both - - groupBox1 + + 329, 215 - - Enable + + 3 - - cboLanguage + + txtAutoExtRule + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 2 - - 0 + + True - + NoControl - - 17, 96 - - - 0 - - - groupBox3 + + 22, 20 - - + + 60, 16 - - + + 2 - - 407, 354 + + Enable - - 0 + + chkAutoExtSwitch - - tabPageNomal + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + groupBox2 - - txtAutoExtRule + + 3 - - 121, 20 + + 6, 6 - - NoControl + + 367, 275 - - 2 + + 12 - - 266, 20 + + Text Extension Rules - - 8 + + groupBox2 - - Top, Bottom, Left, Right + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 96, 69 + + tabPageCustom - - 0, 0 + + 0 - - Settings + + 4, 22 - - NoControl + + 3, 3, 3, 3 - - 0 + + 383, 289 - - 4 + + 0 - - 23, 24 + + Custom - - True + + tabPageCustom - + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - + tabControl1 - - Zoom + + 1 - - Top, Right + + 0, 0 - - Add + + 17, 241 - + + 328, 23 + + + 11 + + + It's the latest version + + TopCenter - - 22, 20 + + False - - 简体中文 + + labelUpdateinfo - - 3, 3, 3, 3 + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabPageAbout - - 199, 21 + + 0 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 169, 241 - - 2 + + 16, 16 - - NoControl + + AutoSize - - 0 + + 9 - - NoControl + + picLoading - - lblTipError + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tabPageAbout - - + + 1 + + + Top, Left, Right + + + 微软雅黑, 9pt + + + NoControl + + + 23, 0 + + + 17, 96 + + + 328, 142 + + + 6 PasteEx @@ -702,259 +735,148 @@ Author:huiyadanli If you have questions or suggestions, please feel free to email me at huiyadanli@gmail.com, or create an Issue here. - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + TopCenter - - 0 + + linkLabel1 - - Top, Left, Right + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + + tabPageAbout - - + + 2 - + NoControl - - groupBox4 - - - 2 - - - btnRegister + + 0, 0 - - 86, 23 + + 100, 23 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 7 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label2 - - 371, 57 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 14 + + tabPageAbout - - 174, 20 + + 3 - - 13 + + Top, Left, Right - - 1 + + NoControl - - 4, 22 + + 135, 15 - - 6, 6 + + 96, 69 - - 71, 12 + + Zoom - + 0 - - 6 - - - The rules is incorrect - - - chkFastNeedShiftKey - - - 86, 23 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + pictureBox1 - - Top, Right + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + + tabPageAbout - - 328, 142 + + 4 4, 22 - - English - - - False + + 383, 289 - - Add + + 2 - - tabPageCustom + + About - - 3, 3, 3, 3 + + tabPageAbout - - 100, 21 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabControl1 2 - - 9 - - - label2 - - - Custom - - - NoControl - - - groupBox2 + + Fill - + 0, 0 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Context Menu - - - btnUnRegister - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NoControl - - - Shift Right Click - - - 6, 132 - - - 22, 42 - - - lblHelp - - - - - - System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - TopCenter - - - Top, Left, Right - - - 6, 12 - - - 5 - - - 9 - - - tipHelp - - - 6 - 391, 315 - - 137, 12 - - - NoControl - - - tabPageAbout - - - True + + 0 - - 0, 0 + + tabControl1 - - Remove + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + $this - + 0 - - btnFastRegister - - - 6, 6 - - - chkAutoExtSwitch + + True + + + 6, 12 - - + + 391, 315 - - + + 407, 354 - - 1 + + Settings - - + + tipHelp - - picLoading + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + FormSetting - - 微软雅黑, 9pt + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - zh-CN - - - 17, 17 - \ No newline at end of file diff --git a/PasteEx/FormSetting.zh-CN.resx b/PasteEx/FormSetting.zh-CN.resx index 8070baa..df9e1df 100644 --- a/PasteEx/FormSetting.zh-CN.resx +++ b/PasteEx/FormSetting.zh-CN.resx @@ -121,135 +121,75 @@ 62, 23 - - - 35, 12 语言: - - - 界面 - - - 138, 16 按住 Shift 显示菜单 - - - 移除 - - - 添加 - - - 快速粘贴右键菜单 - - - 138, 16 按住 Shift 显示菜单 - - - 移除 - - - 添加 - - - 右键菜单 - - - 常规 - - - 149, 12 规则格式有误,将不被启用 - - - 65, 12 如何使用? - - - - - - 48, 16 启用 - - - 文本扩展名规则 - - - 自定义 - - - 已经是最新版本 - - - - - - PasteEx @@ -259,28 +199,10 @@ 如果有问题或者建议,欢迎在 GitHub 上面给我提 Issues,或者发送邮件到 huiyadanli@126.com - - - - - - - - - 关于 - - - - - - 设置 - - - \ No newline at end of file diff --git a/PasteEx/FormSetting.zh-Hant.resx b/PasteEx/FormSetting.zh-Hant.resx new file mode 100644 index 0000000..47b3820 --- /dev/null +++ b/PasteEx/FormSetting.zh-Hant.resx @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 常規 + + + 自定義 + + + 關於 + + + 界面 + + + + 62, 23 + + + 35, 12 + + + 語言: + + + 快速粘貼右鍵菜單 + + + 138, 16 + + + 按住 Shift 顯示菜單 + + + 移除 + + + 添加 + + + 右鍵菜單 + + + 138, 16 + + + 按住 Shift 顯示菜單 + + + 移除 + + + 添加 + + + 文本副檔名規則 + + + 149, 12 + + + 規則格式有誤,將不被啟用 + + + 65, 12 + + + 如何使用? + + + 48, 16 + + + 啟用 + + + 已經是最新版本 + + + PasteEx + +版本:{0} + +作者:huiyadanli + +如果有問題或者建議,歡迎在 GitHub 上面給我提 Issues,或者發送郵件到 huiyadanli@126.com + + + 設置 + + \ No newline at end of file diff --git a/PasteEx/PasteEx.csproj b/PasteEx/PasteEx.csproj index a175b59..ee8469e 100644 --- a/PasteEx/PasteEx.csproj +++ b/PasteEx/PasteEx.csproj @@ -90,6 +90,11 @@ True True + + Strings.zh-Hant.resx + True + True + @@ -112,6 +117,7 @@ Strings.zh-CN.resx + FormMain.cs Designer @@ -119,12 +125,18 @@ FormMain.cs + + FormMain.cs + FormSetting.cs FormSetting.cs + + FormSetting.cs + ResXFileCodeGenerator Resources1.Designer.cs @@ -133,6 +145,10 @@ ResXFileCodeGenerator Strings.Designer.cs + + ResXFileCodeGenerator + Strings.zh-Hant.Designer.cs + ResXFileCodeGenerator Strings.zh-CN.Designer.cs @@ -148,7 +164,9 @@ - + + Designer + @@ -167,6 +185,8 @@ xcopy /s /y zh-CN Language\zh-CN\ -rd /s /q zh-CN +xcopy /s /y zh-Hant Language\zh-Hant\ +rd /s /q zh-CN +rd /s /q zh-Hant \ No newline at end of file diff --git a/PasteEx/Resources/Strings.Designer.cs b/PasteEx/Resources/Strings.Designer.cs index e64adcc..cae7165 100644 --- a/PasteEx/Resources/Strings.Designer.cs +++ b/PasteEx/Resources/Strings.Designer.cs @@ -187,7 +187,7 @@ internal static string TipSaveFailed { } /// - /// 查找类似 The target file {0} has already existed. Overwrite? 的本地化字符串。 + /// 查找类似 The target file {0} already exists. Do you want to overwrite it? 的本地化字符串。 /// internal static string TipTargetFileExisted { get { diff --git a/PasteEx/Resources/Strings.resx b/PasteEx/Resources/Strings.resx index b555935..19448b9 100644 --- a/PasteEx/Resources/Strings.resx +++ b/PasteEx/Resources/Strings.resx @@ -160,7 +160,7 @@ Save failed, please select the correct extension. - The target file {0} has already existed. Overwrite? + The target file {0} already exists. Do you want to overwrite it? The target path does not exist diff --git a/PasteEx/Resources/Strings.zh-Hant.Designer.cs b/PasteEx/Resources/Strings.zh-Hant.Designer.cs new file mode 100644 index 0000000..e69de29 diff --git a/PasteEx/Resources/Strings.zh-Hant.resx b/PasteEx/Resources/Strings.zh-Hant.resx new file mode 100644 index 0000000..8796ecb --- /dev/null +++ b/PasteEx/Resources/Strings.zh-Hant.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 剪貼板內容為空或不被支持,仍舊進入軟件主界面? + + + 檢測到右鍵菜單未添加,是否添加“粘貼為文件”到系統右鍵菜單中? + + + 文件夾路徑不能為空 + + + 右鍵菜單添加成功! + + + 添加右鍵菜單時,請以管理員的身份運行本軟件! + + + 保存失敗,可能是選擇的副檔名不正確 + + + 右鍵菜單移除成功! + + + 檢測到右鍵菜單“粘貼為文件”中的路徑與現在的軟件啟動路徑不同,是否重新添加右鍵菜單? + + + 粘貼為文件 + + + 自定義副檔名規則匹配出錯,請檢查規則是否正確! + + + 自動提取圖片副檔名失敗! + + + 當前妳可以使用設置功能 + + + 規則格式有誤,將不被啟用 + + + 系統錯誤 + + + 剪貼板內容為空或不被支持 + + + 目標文件 {0} 已經存在,是否覆蓋? + + + 粘貼目標路徑不存在 + + + 粘貼為文件 + + + 快速粘貼為文件 + + + 下載圖片中...{0}% + + + 下載失敗 + + + PasteEx + +版本:{0} + +作者:huiyadanli + +如果有問題或者建議,歡迎在 GitHub 上面給我提 Issues,或者發送郵件到 huiyadanli@126.com + + + 已經是最新版本 + + + 存在新版本: + + + 規則格式:副檔名=與此副檔名相對應文本的第壹行特征(支持正則) + +對於文本類型的文件,將會取第壹個非空行對特征進行匹配, +匹配成功則在保存時默認使用對應的自定義副檔名。 + +比如: + cs=^using .*;$ + java=^package.*;$ + html=(? i)<!DOCTYPE html + cpp=^#include.* + + + 錯誤的版本號: + + \ No newline at end of file diff --git a/PasteEx/Util/I18n.cs b/PasteEx/Util/I18n.cs index 9d2f604..bcaa028 100644 --- a/PasteEx/Util/I18n.cs +++ b/PasteEx/Util/I18n.cs @@ -27,7 +27,8 @@ public Language(int index, string localName, string ciName) public static List SupportLanguage = new List { new Language(0,"English","en-US"), - new Language(1,"简体中文","zh-CN") + new Language(1,"简体中文","zh-CN"), + new Language(2,"繁體中文","zh-Hant") }; internal static Language FindLanguageByIndex(int index) @@ -66,7 +67,12 @@ internal static Language FindLanguageByName(string name) internal static Language FindLanguageByCurrentThreadInfo() { CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentUICulture; - if (ci.Name.Contains("zh")) + string name = ci.Name; + if (name.Contains("zh-Hant") || name.Contains("zh-HK") || name.Contains("zh-TW")) + { + return SupportLanguage[2]; + } + else if (name.Contains("zh")) { return SupportLanguage[1]; } @@ -75,10 +81,12 @@ internal static Language FindLanguageByCurrentThreadInfo() internal static void InitCurrentCulture() { + #pragma warning disable 0618 + AppDomain.CurrentDomain.AppendPrivatePath("Language"); int index = -1; try { - if(!String.IsNullOrWhiteSpace(Properties.Settings.Default.language)) + if (!String.IsNullOrWhiteSpace(Properties.Settings.Default.language)) { index = Convert.ToInt32(Properties.Settings.Default.language); Language language = FindLanguageByIndex(index); diff --git a/PasteEx/Util/UpdateRepairer.cs b/PasteEx/Util/UpdateRepairer.cs new file mode 100644 index 0000000..3f9c182 --- /dev/null +++ b/PasteEx/Util/UpdateRepairer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace PasteEx.Util +{ + internal class UpdateRepairer + { + /// + /// 1.0.2.6 to ~ + /// + internal static void UserSettingFolderNameChange() + { + string oldPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "PasteEx", "PasteEx.settings"); + string newPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "User"); + if (File.Exists(oldPath) && !Directory.Exists(newPath)) + { + Directory.CreateDirectory(newPath); + File.Copy(newPath, oldPath); + } + } + } +}