Skip to content

Commit 0af311f

Browse files
committed
Update dictionary value
Signed-off-by: Florian Grabmeier <[email protected]>
1 parent 4071c11 commit 0af311f

File tree

1 file changed

+22
-21
lines changed
  • Plugins/Flow.Launcher.Plugin.Sys

1 file changed

+22
-21
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,36 @@ private string GetDynamicTitle(Query query, Result result)
9494
return "Title Not Found";
9595
}
9696

97+
var translatedTitle = context.API.GetTranslation(pair.Value);
9798
var englishTitleMatch = StringMatcher.FuzzySearch(query.Search, pair.Key);
98-
var translatedTitleMatch = StringMatcher.FuzzySearch(query.Search, pair.Value);
99+
var translatedTitleMatch = StringMatcher.FuzzySearch(query.Search, translatedTitle);
99100

100-
return englishTitleMatch.Score >= translatedTitleMatch.Score ? pair.Key : pair.Value;
101+
return englishTitleMatch.Score >= translatedTitleMatch.Score ? pair.Key : translatedTitle;
101102
}
102103

103104
public void Init(PluginInitContext context)
104105
{
105106
this.context = context;
106107
KeywordTitleMappings = new Dictionary<string, string>{
107-
{"Shutdown", context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer_cmd")},
108-
{"Restart", context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer_cmd")},
109-
{"Restart With Advanced Boot Options", context.API.GetTranslation("flowlauncher_plugin_sys_restart_advanced_cmd")},
110-
{"Log Off/Sign Out", context.API.GetTranslation("flowlauncher_plugin_sys_log_off_cmd")},
111-
{"Lock", context.API.GetTranslation("flowlauncher_plugin_sys_lock_cmd")},
112-
{"Sleep", context.API.GetTranslation("flowlauncher_plugin_sys_sleep_cmd")},
113-
{"Hibernate", context.API.GetTranslation("flowlauncher_plugin_sys_hibernate_cmd")},
114-
{"Index Option", context.API.GetTranslation("flowlauncher_plugin_sys_indexoption_cmd")},
115-
{"Empty Recycle Bin", context.API.GetTranslation("flowlauncher_plugin_sys_emptyrecyclebin_cmd")},
116-
{"Open Recycle Bin", context.API.GetTranslation("flowlauncher_plugin_sys_openrecyclebin_cmd")},
117-
{"Exit", context.API.GetTranslation("flowlauncher_plugin_sys_exit_cmd")},
118-
{"Save Settings", context.API.GetTranslation("flowlauncher_plugin_sys_save_all_settings_cmd")},
119-
{"Restart Flow Launcher", context.API.GetTranslation("flowlauncher_plugin_sys_restart_cmd")},
120-
{"Settings", context.API.GetTranslation("flowlauncher_plugin_sys_setting_cmd")},
121-
{"Reload Plugin Data", context.API.GetTranslation("flowlauncher_plugin_sys_reload_plugin_data_cmd")},
122-
{"Check For Update", context.API.GetTranslation("flowlauncher_plugin_sys_check_for_update_cmd")},
123-
{"Open Log Location", context.API.GetTranslation("flowlauncher_plugin_sys_open_log_location_cmd")},
124-
{"Flow Launcher Tips", context.API.GetTranslation("flowlauncher_plugin_sys_open_docs_tips_cmd")},
125-
{"Flow Launcher UserData Folder", context.API.GetTranslation("flowlauncher_plugin_sys_open_userdata_location_cmd")}
108+
{"Shutdown", "flowlauncher_plugin_sys_shutdown_computer_cmd"},
109+
{"Restart", "flowlauncher_plugin_sys_restart_computer_cmd"},
110+
{"Restart With Advanced Boot Options", "flowlauncher_plugin_sys_restart_advanced_cmd"},
111+
{"Log Off/Sign Out", "flowlauncher_plugin_sys_log_off_cmd"},
112+
{"Lock", "flowlauncher_plugin_sys_lock_cmd"},
113+
{"Sleep", "flowlauncher_plugin_sys_sleep_cmd"},
114+
{"Hibernate", "flowlauncher_plugin_sys_hibernate_cmd"},
115+
{"Index Option", "flowlauncher_plugin_sys_indexoption_cmd"},
116+
{"Empty Recycle Bin", "flowlauncher_plugin_sys_emptyrecyclebin_cmd"},
117+
{"Open Recycle Bin", "flowlauncher_plugin_sys_openrecyclebin_cmd"},
118+
{"Exit", "flowlauncher_plugin_sys_exit_cmd"},
119+
{"Save Settings", "flowlauncher_plugin_sys_save_all_settings_cmd"},
120+
{"Restart Flow Launcher", "flowlauncher_plugin_sys_restart_cmd"},
121+
{"Settings", "flowlauncher_plugin_sys_setting_cmd"},
122+
{"Reload Plugin Data", "flowlauncher_plugin_sys_reload_plugin_data_cmd"},
123+
{"Check For Update", "flowlauncher_plugin_sys_check_for_update_cmd"},
124+
{"Open Log Location", "flowlauncher_plugin_sys_open_log_location_cmd"},
125+
{"Flow Launcher Tips", "flowlauncher_plugin_sys_open_docs_tips_cmd"},
126+
{"Flow Launcher UserData Folder", "flowlauncher_plugin_sys_open_userdata_location_cmd"}
126127
};
127128
}
128129

0 commit comments

Comments
 (0)