10
10
11
11
namespace Flow . Launcher . Plugin . ProcessKiller
12
12
{
13
- public class Main : IPlugin
13
+ public class Main : IPlugin , IPluginI18n
14
14
{
15
15
private readonly HashSet < string > _systemProcessList = new HashSet < string > ( ) {
16
16
"conhost" ,
@@ -28,6 +28,13 @@ public class Main : IPlugin
28
28
"spoolsv" ,
29
29
"explorer" } ;
30
30
31
+ private static PluginInitContext _context ;
32
+
33
+ public void Init ( PluginInitContext context )
34
+ {
35
+ _context = context ;
36
+ }
37
+
31
38
public List < Result > Query ( Query query )
32
39
{
33
40
var termToSearch = query . Terms . Length == 1
@@ -41,6 +48,16 @@ public List<Result> Query(Query query)
41
48
: CreateResultsFromProcesses ( processlist , termToSearch ) ;
42
49
}
43
50
51
+ public string GetTranslatedPluginTitle ( )
52
+ {
53
+ return _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_plugin_name" ) ;
54
+ }
55
+
56
+ public string GetTranslatedPluginDescription ( )
57
+ {
58
+ return _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_plugin_description" ) ;
59
+ }
60
+
44
61
private List < Result > CreateResultsFromProcesses ( List < ProcessResult > processlist , string termToSearch )
45
62
{
46
63
var results = new List < Result > ( ) ;
@@ -69,7 +86,7 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
69
86
results . Insert ( 0 , new Result ( )
70
87
{
71
88
IcoPath = "Images\\ app.png" ,
72
- Title = "kill all \" " + termToSearch + " \" processes" ,
89
+ Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , termToSearch ) ,
73
90
SubTitle = "" ,
74
91
Score = 200 ,
75
92
Action = ( c ) =>
@@ -158,10 +175,6 @@ private string GetPath(Process p)
158
175
}
159
176
}
160
177
161
- public void Init ( PluginInitContext context )
162
- {
163
- }
164
-
165
178
[ Flags ]
166
179
private enum ProcessAccessFlags : uint
167
180
{
0 commit comments