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>
/// Plugin interface used by an editor to notify third-party code providers.
@ -26,6 +26,13 @@ public interface IPlugin
/// </summary>
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>
/// Attempts to load a file using the plugin.
/// </summary>

View file

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