Add plugin stub for notifying GUI language change

This commit is contained in:
Kurt 2024-01-08 19:56:04 -08:00
parent 3ba2e8e376
commit d7473db6af
2 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,4 @@
namespace PKHeX.Core; namespace PKHeX.Core;
/// <summary> /// <summary>
/// Plugin interface used by an editor to notify third-party code providers. /// Plugin interface used by an editor to notify third-party code providers.
@ -26,6 +26,13 @@ public interface IPlugin
/// </summary> /// </summary>
void NotifySaveLoaded(); void NotifySaveLoaded();
/// <summary>
/// Notifies the plugin that the display language has changed.
/// </summary>
/// <param name="language">Short code for language name</param>
/// <remarks>Useful to translate controls if any added.</remarks>
void NotifyDisplayLanguageChanged(string language) { }
/// <summary> /// <summary>
/// Attempts to load a file using the plugin. /// Attempts to load a file using the plugin.
/// </summary> /// </summary>

View file

@ -974,6 +974,9 @@ public partial class Main : Form
PKME_Tabs.PopulateFields(pk); // put data back in form PKME_Tabs.PopulateFields(pk); // put data back in form
Text = GetProgramTitle(sav); Text = GetProgramTitle(sav);
} }
foreach (var plugin in Plugins)
plugin.NotifyDisplayLanguageChanged(lang);
} }
#endregion #endregion