From cee43a3c4bf8cec509ef40bd54e735cf0eeff76f Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 19 Apr 2018 15:36:43 -0700 Subject: [PATCH] Fix translating non-translatables addnew adds a key when not found in original translation, which results in translating to the old value when flipping back to that language. can result in invalid values if the control is used as any data display (ie Gender label) https://projectpokemon.org/home/forums/topic/44926-when-i-changed-the-language-a-bug-about-gender-occurred/ --- PKHeX.WinForms/Util/DevUtil.cs | 1 + PKHeX.WinForms/Util/WinFormsTranslator.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Util/DevUtil.cs b/PKHeX.WinForms/Util/DevUtil.cs index e703abd4f..31cff24d2 100644 --- a/PKHeX.WinForms/Util/DevUtil.cs +++ b/PKHeX.WinForms/Util/DevUtil.cs @@ -25,6 +25,7 @@ public static void UpdateAll() private static void UpdateTranslations() { + WinFormsTranslator.SetRemovalMode(false); // add mode WinFormsTranslator.LoadAllForms(LoadBanlist); // populate with every possible control WinFormsTranslator.UpdateAll(DefaultLanguage, Languages); // propagate to others WinFormsTranslator.DumpAll(Banlist); // dump current to file diff --git a/PKHeX.WinForms/Util/WinFormsTranslator.cs b/PKHeX.WinForms/Util/WinFormsTranslator.cs index b82de6c4d..02c004b6d 100644 --- a/PKHeX.WinForms/Util/WinFormsTranslator.cs +++ b/PKHeX.WinForms/Util/WinFormsTranslator.cs @@ -186,7 +186,7 @@ public static void RemoveAll(string defaultLanguage, params string[] banlist) public class TranslationContext { - public bool AddNew { private get; set; } = true; + public bool AddNew { private get; set; } public bool RemoveUsedKeys { private get; set; } public const char Separator = '='; private readonly Dictionary Translation = new Dictionary();