From af3aaa8ce79bbd6e1552aa67da2f8603d23e64e1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 21 Jul 2025 10:29:14 +0800 Subject: [PATCH] Update labels for setting view model when culture info changes --- Plugins/Flow.Launcher.Plugin.Explorer/Main.cs | 9 ++++++++- .../Views/ExplorerSettings.xaml.cs | 4 ---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index 719e60af3..0850d4e10 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -1,4 +1,4 @@ -using Flow.Launcher.Plugin.Explorer.Helper; +using Flow.Launcher.Plugin.Explorer.Helper; using Flow.Launcher.Plugin.Explorer.Search; using Flow.Launcher.Plugin.Explorer.Search.Everything; using Flow.Launcher.Plugin.Explorer.ViewModels; @@ -11,6 +11,7 @@ using System.Threading.Tasks; using System.Windows.Controls; using Flow.Launcher.Plugin.Explorer.Exceptions; using System.Linq; +using System.Globalization; namespace Flow.Launcher.Plugin.Explorer { @@ -97,6 +98,12 @@ namespace Flow.Launcher.Plugin.Explorer return Context.API.GetTranslation("plugin_explorer_plugin_description"); } + public void OnCultureInfoChanged(CultureInfo newCulture) + { + // Update labels for setting view model + EverythingSortOptionLocalized.UpdateLabels(viewModel.AllEverythingSortOptions); + } + private static void FillQuickAccessLinkNames() { // Legacy version does not have names for quick access links, so we fill them with the path name. diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs index de33b80d6..7cdc7b6cf 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using System.Windows; using System.Windows.Controls; -using Flow.Launcher.Plugin.Explorer.Search.Everything; using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using Flow.Launcher.Plugin.Explorer.ViewModels; using DataFormats = System.Windows.DataFormats; @@ -39,9 +38,6 @@ namespace Flow.Launcher.Plugin.Explorer.Views QuickAccessExpander, ExcludedPathsExpander }; - - // Update labels on initialization to update on language change - EverythingSortOptionLocalized.UpdateLabels(_viewModel.AllEverythingSortOptions); } private void AccessLinkDragDrop(string containerName, DragEventArgs e)