From 02d94876c34d5fff349e8476666a66d447487b8e Mon Sep 17 00:00:00 2001 From: Korney Czukowski Date: Wed, 20 Dec 2017 07:29:16 +0100 Subject: [PATCH] Add language switch control to form, localization strings --- DS4Windows/DS4Forms/DS4Form.Designer.cs | 11 + DS4Windows/DS4Forms/DS4Form.cs | 10 +- DS4Windows/DS4Forms/DS4Form.cs.resx | 716 ++++++------- DS4Windows/DS4Forms/DS4Form.resx | 638 +++++++----- DS4Windows/DS4Forms/DS4Form.ru-RU.resx | 986 +++++++++--------- DS4Windows/Properties/Resources.Designer.cs | 11 +- DS4Windows/Properties/Resources.cs.resx | 3 + DS4Windows/Properties/Resources.resx | 1015 ++++++++++--------- 8 files changed, 1797 insertions(+), 1593 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.Designer.cs b/DS4Windows/DS4Forms/DS4Form.Designer.cs index 413fabd..ad45738 100644 --- a/DS4Windows/DS4Forms/DS4Form.Designer.cs +++ b/DS4Windows/DS4Forms/DS4Form.Designer.cs @@ -146,6 +146,7 @@ this.lbUseXIPorts = new System.Windows.Forms.Label(); this.nUDXIPorts = new System.Windows.Forms.NumericUpDown(); this.lbLastXIPort = new System.Windows.Forms.Label(); + this.languagePackComboBox1 = new DS4Windows.DS4Forms.LanguagePackComboBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.linkProfiles = new System.Windows.Forms.LinkLabel(); this.lnkControllers = new System.Windows.Forms.LinkLabel(); @@ -892,6 +893,7 @@ this.fLPSettings.Controls.Add(this.cBUpdate); this.fLPSettings.Controls.Add(this.pNUpdate); this.fLPSettings.Controls.Add(this.pnlXIPorts); + this.fLPSettings.Controls.Add(this.languagePackComboBox1); this.fLPSettings.Controls.Add(this.flowLayoutPanel1); this.fLPSettings.Name = "fLPSettings"; // @@ -1136,6 +1138,14 @@ resources.ApplyResources(this.lbLastXIPort, "lbLastXIPort"); this.lbLastXIPort.Name = "lbLastXIPort"; // + // languagePackComboBox1 + // + resources.ApplyResources(this.languagePackComboBox1, "languagePackComboBox1"); + this.languagePackComboBox1.LanguageAssemblyName = "DS4Windows.resources.dll"; + this.languagePackComboBox1.Name = "languagePackComboBox1"; + this.languagePackComboBox1.ProbingPath = "Lang"; + this.languagePackComboBox1.SelectedValueChanged += new System.EventHandler(this.languagePackComboBox1_SelectedValueChanged); + // // flowLayoutPanel1 // resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); @@ -1430,6 +1440,7 @@ private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Button exportLogTxtBtn; private System.Windows.Forms.Button btnClear; + private DS4Forms.LanguagePackComboBox languagePackComboBox1; //private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; } } diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 635b3e4..c9fdb8e 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -2501,9 +2501,13 @@ namespace DS4Windows private void languagePackComboBox1_SelectedValueChanged(object sender, EventArgs e) { - UseLang = ((DS4Forms.LanguagePackComboBox)sender).SelectedValue.ToString(); - Save(); - MessageBox.Show("DS4Windows must be restarted in order to have an effect."); + string newValue = ((DS4Forms.LanguagePackComboBox)sender).SelectedValue.ToString(); + if (newValue != UseLang) + { + UseLang = newValue; + Save(); + MessageBox.Show(Properties.Resources.LanguagePackApplyRestartRequired, Text, MessageBoxButtons.OK, MessageBoxIcon.Information); + } } private void cBFlashWhenLate_CheckedChanged(object sender, EventArgs e) diff --git a/DS4Windows/DS4Forms/DS4Form.cs.resx b/DS4Windows/DS4Forms/DS4Form.cs.resx index 75ce899..393b2fa 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs.resx +++ b/DS4Windows/DS4Forms/DS4Form.cs.resx @@ -1,4 +1,4 @@ - +