Skip to content

Commit bc0cde2

Browse files
committed
Add translations for system plugin command column
1 parent 9b28161 commit bc0cde2

File tree

1 file changed

+11
-2
lines changed
  • Plugins/Flow.Launcher.Plugin.Sys

1 file changed

+11
-2
lines changed

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

+11-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ public class Main : IPlugin, ISettingProvider, IPluginI18n
2828

2929
public Control CreateSettingPanel()
3030
{
31-
var results = Commands();
32-
return new SysSettings(results);
31+
var commands = Commands();
32+
foreach (var c in commands)
33+
{
34+
c.Title = GetDynamicTitle(null, c);
35+
}
36+
return new SysSettings(commands);
3337
}
3438

3539
public List<Result> Query(Query query)
@@ -73,6 +77,11 @@ private string GetDynamicTitle(Query query, Result result)
7377

7478
var translatedTitle = context.API.GetTranslation(translationKey);
7579

80+
if (query == null)
81+
{
82+
return translatedTitle;
83+
}
84+
7685
if (result.Title == translatedTitle)
7786
{
7887
return result.Title;

0 commit comments

Comments
 (0)