From ef3553956c066e4427f89f8d67e6e4f55ee36a04 Mon Sep 17 00:00:00 2001 From: iCAROS7 Date: Tue, 11 Dec 2018 21:21:55 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=88=EC=A7=80=EB=A7=89=20=EC=96=B8?= =?UTF-8?q?=EC=96=B4=20=EC=A0=80=EC=9E=A5=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Funbit.Ets.Telemetry.Server/App.config | 10 ------ .../Helpers/Settings.cs | 1 + .../Funbit.Ets.Telemetry.Server/MainForm.cs | 36 +++++++++---------- .../Properties/Settings.Designer.cs | 12 ------- .../Properties/Settings.settings | 8 ++--- 5 files changed, 19 insertions(+), 48 deletions(-) diff --git a/source/Funbit.Ets.Telemetry.Server/App.config b/source/Funbit.Ets.Telemetry.Server/App.config index f36dc92e..190208d6 100644 --- a/source/Funbit.Ets.Telemetry.Server/App.config +++ b/source/Funbit.Ets.Telemetry.Server/App.config @@ -2,9 +2,6 @@
- -
- @@ -68,11 +65,4 @@ - - - - 0 - - - \ No newline at end of file diff --git a/source/Funbit.Ets.Telemetry.Server/Helpers/Settings.cs b/source/Funbit.Ets.Telemetry.Server/Helpers/Settings.cs index 40844c60..6228b5ed 100644 --- a/source/Funbit.Ets.Telemetry.Server/Helpers/Settings.cs +++ b/source/Funbit.Ets.Telemetry.Server/Helpers/Settings.cs @@ -15,6 +15,7 @@ public class Settings public bool FirewallSetupHadErrors { get; set; } public bool UrlReservationSetupHadErrors { get; set; } + public string LastLang { get; set; } #endregion diff --git a/source/Funbit.Ets.Telemetry.Server/MainForm.cs b/source/Funbit.Ets.Telemetry.Server/MainForm.cs index 081d38f8..70f9b5e6 100644 --- a/source/Funbit.Ets.Telemetry.Server/MainForm.cs +++ b/source/Funbit.Ets.Telemetry.Server/MainForm.cs @@ -154,6 +154,11 @@ void Start() void MainForm_Load(object sender, EventArgs e) { + // Check Last Settings + Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Instance.LastLang); + // Apply Locale + FormInitialize(); + // log current version for debugging Log.InfoFormat("{0} ({1}) {2}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64" + StringLib.CurrentVersion_Bit : "32" + StringLib.CurrentVersion_Bit, @@ -164,19 +169,6 @@ void MainForm_Load(object sender, EventArgs e) Setup(); Start(); - - // Check Last Settings - if (Properties.Settings.Default.Lang == 0) - { - Lang_ko_ToolStripMenuItem.PerformClick(); - } - else if (Properties.Settings.Default.Lang == 1) - { - Lang_en_ToolStripMenuItem.PerformClick(); - } - - // Apply Locale - FormInitialize(); } void MainForm_FormClosed(object sender, FormClosedEventArgs e) @@ -326,17 +318,21 @@ private void TranslateToolStripMenuItem_Click(object sender, EventArgs e) private void Lang_ko_ToolStripMenuItem_Click(object sender, EventArgs e) { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("ko"); - Properties.Settings.Default.Lang = 0; - Properties.Settings.Default.Save(); - FormInitialize(); + ChangeLang("ko", Lang_ko_ToolStripMenuItem.Text); } private void Lang_en_ToolStripMenuItem_Click(object sender, EventArgs e) { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("en"); - Properties.Settings.Default.Lang = 1; - Properties.Settings.Default.Save(); + ChangeLang("en", Lang_en_ToolStripMenuItem.Text); + } + + private void ChangeLang(string lang, string lang_button) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); + Settings.Instance.LastLang = lang; + Settings.Instance.Save(); + MessageBox.Show(StringLib.Settings_Lang_LogInfo, StringLib.Information, MessageBoxButtons.OK ,MessageBoxIcon.Information); + Log.InfoFormat(StringLib.Settings_Lang_1 + lang_button + StringLib.Settings_Lang_2); FormInitialize(); } } diff --git a/source/Funbit.Ets.Telemetry.Server/Properties/Settings.Designer.cs b/source/Funbit.Ets.Telemetry.Server/Properties/Settings.Designer.cs index dd5d3e2f..9152b00b 100644 --- a/source/Funbit.Ets.Telemetry.Server/Properties/Settings.Designer.cs +++ b/source/Funbit.Ets.Telemetry.Server/Properties/Settings.Designer.cs @@ -22,17 +22,5 @@ public static Settings Default { return defaultInstance; } } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int Lang { - get { - return ((int)(this["Lang"])); - } - set { - this["Lang"] = value; - } - } } } diff --git a/source/Funbit.Ets.Telemetry.Server/Properties/Settings.settings b/source/Funbit.Ets.Telemetry.Server/Properties/Settings.settings index 2a31e518..8e615f25 100644 --- a/source/Funbit.Ets.Telemetry.Server/Properties/Settings.settings +++ b/source/Funbit.Ets.Telemetry.Server/Properties/Settings.settings @@ -1,9 +1,5 @@  - + - - - 0 - - + \ No newline at end of file