From 1a672878a9e93b4e438eb612280ea1151a0bb494 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 13 Apr 2024 00:43:59 -0500 Subject: [PATCH] feat(i18n): make empty hotkey translatable --- Flow.Launcher/Languages/en.xaml | 1 + Flow.Launcher/ViewModel/HotkeyControlViewModel.cs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 4bc79ccb3..d210c20dc 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -170,6 +170,7 @@ Date + <empty> Hotkey Hotkeys Flow Launcher Hotkey diff --git a/Flow.Launcher/ViewModel/HotkeyControlViewModel.cs b/Flow.Launcher/ViewModel/HotkeyControlViewModel.cs index e273e0fe3..13e6e320f 100644 --- a/Flow.Launcher/ViewModel/HotkeyControlViewModel.cs +++ b/Flow.Launcher/ViewModel/HotkeyControlViewModel.cs @@ -50,6 +50,8 @@ namespace Flow.Launcher.ViewModel DefaultHotkey = defaultHotkey; ValidateKeyGesture = validateKeyGesture; HotkeyDelegate = hotkeyDelegate; + EmptyKeyValue = InternationalizationManager.Instance.GetTranslation("empty"); + KeysToDisplay = new ObservableCollection { EmptyKeyValue }; if (string.IsNullOrEmpty(Hotkey)) { @@ -60,10 +62,10 @@ namespace Flow.Launcher.ViewModel } - private const string EmptyKeyValue = ""; + private string EmptyKeyValue = ""; private const string KeySeparator = " + "; - public ObservableCollection KeysToDisplay { get; } = new() { EmptyKeyValue }; + public ObservableCollection KeysToDisplay { get; } public HotkeyModel CurrentHotkey { get; private set; }