Skip to content

Commit af3aaa8

Browse files
committed
Update labels for setting view model when culture info changes
1 parent b9e0669 commit af3aaa8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Main.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Flow.Launcher.Plugin.Explorer.Helper;
1+
using Flow.Launcher.Plugin.Explorer.Helper;
22
using Flow.Launcher.Plugin.Explorer.Search;
33
using Flow.Launcher.Plugin.Explorer.Search.Everything;
44
using Flow.Launcher.Plugin.Explorer.ViewModels;
@@ -11,6 +11,7 @@
1111
using System.Windows.Controls;
1212
using Flow.Launcher.Plugin.Explorer.Exceptions;
1313
using System.Linq;
14+
using System.Globalization;
1415

1516
namespace Flow.Launcher.Plugin.Explorer
1617
{
@@ -97,6 +98,12 @@ public string GetTranslatedPluginDescription()
9798
return Context.API.GetTranslation("plugin_explorer_plugin_description");
9899
}
99100

101+
public void OnCultureInfoChanged(CultureInfo newCulture)
102+
{
103+
// Update labels for setting view model
104+
EverythingSortOptionLocalized.UpdateLabels(viewModel.AllEverythingSortOptions);
105+
}
106+
100107
private static void FillQuickAccessLinkNames()
101108
{
102109
// Legacy version does not have names for quick access links, so we fill them with the path name.

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Linq;
55
using System.Windows;
66
using System.Windows.Controls;
7-
using Flow.Launcher.Plugin.Explorer.Search.Everything;
87
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
98
using Flow.Launcher.Plugin.Explorer.ViewModels;
109
using DataFormats = System.Windows.DataFormats;
@@ -39,9 +38,6 @@ public ExplorerSettings(SettingsViewModel viewModel)
3938
QuickAccessExpander,
4039
ExcludedPathsExpander
4140
};
42-
43-
// Update labels on initialization to update on language change
44-
EverythingSortOptionLocalized.UpdateLabels(_viewModel.AllEverythingSortOptions);
4541
}
4642

4743
private void AccessLinkDragDrop(string containerName, DragEventArgs e)

0 commit comments

Comments
 (0)