@@ -40,7 +40,7 @@ public class Main : IPlugin, IPluginI18n
40
40
"(?:/\\ S*)?" +
41
41
"$" ;
42
42
Regex reg = new Regex ( urlPattern , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ;
43
- private PluginInitContext context ;
43
+ internal static PluginInitContext Context { get ; private set ; }
44
44
private Settings _settings ;
45
45
46
46
public List < Result > Query ( Query query )
@@ -53,7 +53,7 @@ public List<Result> Query(Query query)
53
53
new Result
54
54
{
55
55
Title = raw ,
56
- SubTitle = string . Format ( context . API . GetTranslation ( " flowlauncher_plugin_url_open_url" ) , raw ) ,
56
+ SubTitle = Localize . flowlauncher_plugin_url_open_url ( raw ) ,
57
57
IcoPath = "Images/url.png" ,
58
58
Score = 8 ,
59
59
Action = _ =>
@@ -64,13 +64,13 @@ public List<Result> Query(Query query)
64
64
}
65
65
try
66
66
{
67
- context . API . OpenUrl ( raw ) ;
67
+ Context . API . OpenUrl ( raw ) ;
68
68
69
69
return true ;
70
70
}
71
71
catch ( Exception )
72
72
{
73
- context . API . ShowMsgError ( string . Format ( context . API . GetTranslation ( " flowlauncher_plugin_url_cannot_open_url" ) , raw ) ) ;
73
+ Context . API . ShowMsgError ( Localize . flowlauncher_plugin_url_cannot_open_url ( raw ) ) ;
74
74
return false ;
75
75
}
76
76
}
@@ -99,19 +99,19 @@ public bool IsURL(string raw)
99
99
100
100
public void Init ( PluginInitContext context )
101
101
{
102
- this . context = context ;
102
+ Context = context ;
103
103
104
104
_settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
105
105
}
106
106
107
107
public string GetTranslatedPluginTitle ( )
108
108
{
109
- return context . API . GetTranslation ( " flowlauncher_plugin_url_plugin_name" ) ;
109
+ return Localize . flowlauncher_plugin_url_plugin_name ( ) ;
110
110
}
111
111
112
112
public string GetTranslatedPluginDescription ( )
113
113
{
114
- return context . API . GetTranslation ( " flowlauncher_plugin_url_plugin_description" ) ;
114
+ return Localize . flowlauncher_plugin_url_plugin_description ( ) ;
115
115
}
116
116
}
117
117
}
0 commit comments