feat(i18n): make empty hotkey translatable

This commit is contained in:
Hongtao Zhang 2024-04-13 00:43:59 -05:00
parent fe80141c1e
commit 1a672878a9
2 changed files with 5 additions and 2 deletions

View file

@ -170,6 +170,7 @@
<system:String x:Key="Date">Date</system:String>
<!-- Setting Hotkey -->
<system:String x:Key="emptyHotkey">&lt;empty&gt;</system:String>
<system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="hotkeys">Hotkeys</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String>

View file

@ -50,6 +50,8 @@ namespace Flow.Launcher.ViewModel
DefaultHotkey = defaultHotkey;
ValidateKeyGesture = validateKeyGesture;
HotkeyDelegate = hotkeyDelegate;
EmptyKeyValue = InternationalizationManager.Instance.GetTranslation("empty");
KeysToDisplay = new ObservableCollection<string> { EmptyKeyValue };
if (string.IsNullOrEmpty(Hotkey))
{
@ -60,10 +62,10 @@ namespace Flow.Launcher.ViewModel
}
private const string EmptyKeyValue = "<empty>";
private string EmptyKeyValue = "<empty>";
private const string KeySeparator = " + ";
public ObservableCollection<string> KeysToDisplay { get; } = new() { EmptyKeyValue };
public ObservableCollection<string> KeysToDisplay { get; }
public HotkeyModel CurrentHotkey { get; private set; }