diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 78e8c5cbf..374f7c71f 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -10,6 +10,7 @@ using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using System.Globalization; +using System.Threading.Tasks; namespace Flow.Launcher.Core.Resource { @@ -95,10 +96,13 @@ namespace Flow.Launcher.Core.Resource { LoadLanguage(language); } - UpdatePluginMetadataTranslations(); Settings.Language = language.LanguageCode; CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode); CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; + Task.Run(() => + { + UpdatePluginMetadataTranslations(); + }); } public bool PromptShouldUsePinyin(string languageCodeToSet) diff --git a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs index e332d450e..e8e861af6 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs @@ -1,4 +1,6 @@ -namespace Flow.Launcher.Plugin +using System.Globalization; + +namespace Flow.Launcher.Plugin { /// /// Represent plugins that support internationalization @@ -8,5 +10,10 @@ string GetTranslatedPluginTitle(); string GetTranslatedPluginDescription(); + + void OnCultureInfoChanged(CultureInfo newCulture) + { + + } } } \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs index b531ac97e..491bb903f 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Main.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Reflection; using Flow.Launcher.Plugin; using Flow.Plugin.WindowsSettings.Classes; @@ -106,6 +107,11 @@ namespace Flow.Plugin.WindowsSettings } + public void OnCultureInfoChanged(CultureInfo newCulture) + { + _translatedSettingList = TranslationHelper.TranslateAllSettings(_settingsList); + } + /// /// Return a list context menu entries for a given (shown at the right side of the result). ///