From d7473db6af142e2029eaebc982a9b08cf9eee1d4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 8 Jan 2024 19:56:04 -0800 Subject: [PATCH] Add plugin stub for notifying GUI language change --- PKHeX.Core/Editing/IPlugin.cs | 9 ++++++++- PKHeX.WinForms/MainWindow/Main.cs | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Editing/IPlugin.cs b/PKHeX.Core/Editing/IPlugin.cs index 0cfaa3902..33497706e 100644 --- a/PKHeX.Core/Editing/IPlugin.cs +++ b/PKHeX.Core/Editing/IPlugin.cs @@ -1,4 +1,4 @@ -namespace PKHeX.Core; +namespace PKHeX.Core; /// /// Plugin interface used by an editor to notify third-party code providers. @@ -26,6 +26,13 @@ public interface IPlugin /// void NotifySaveLoaded(); + /// + /// Notifies the plugin that the display language has changed. + /// + /// Short code for language name + /// Useful to translate controls if any added. + void NotifyDisplayLanguageChanged(string language) { } + /// /// Attempts to load a file using the plugin. /// diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index 36607c466..06b62cf6f 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -974,6 +974,9 @@ private void ChangeMainLanguage(object sender, EventArgs e) PKME_Tabs.PopulateFields(pk); // put data back in form Text = GetProgramTitle(sav); } + + foreach (var plugin in Plugins) + plugin.NotifyDisplayLanguageChanged(lang); } #endregion