@@ -40,7 +40,7 @@ public class Main : IPlugin, IPluginI18n
4040 "(?:/\\ S*)?" +
4141 "$" ;
4242 Regex reg = new Regex ( urlPattern , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ;
43- private PluginInitContext context ;
43+ internal static PluginInitContext Context { get ; private set ; }
4444 private Settings _settings ;
4545
4646 public List < Result > Query ( Query query )
@@ -53,7 +53,7 @@ public List<Result> Query(Query query)
5353 new Result
5454 {
5555 Title = raw ,
56- SubTitle = string . Format ( context . API . GetTranslation ( " flowlauncher_plugin_url_open_url" ) , raw ) ,
56+ SubTitle = Localize . flowlauncher_plugin_url_open_url ( raw ) ,
5757 IcoPath = "Images/url.png" ,
5858 Score = 8 ,
5959 Action = _ =>
@@ -64,13 +64,13 @@ public List<Result> Query(Query query)
6464 }
6565 try
6666 {
67- context . API . OpenUrl ( raw ) ;
67+ Context . API . OpenUrl ( raw ) ;
6868
6969 return true ;
7070 }
7171 catch ( Exception )
7272 {
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 ) ) ;
7474 return false ;
7575 }
7676 }
@@ -99,19 +99,19 @@ public bool IsURL(string raw)
9999
100100 public void Init ( PluginInitContext context )
101101 {
102- this . context = context ;
102+ Context = context ;
103103
104104 _settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
105105 }
106106
107107 public string GetTranslatedPluginTitle ( )
108108 {
109- return context . API . GetTranslation ( " flowlauncher_plugin_url_plugin_name" ) ;
109+ return Localize . flowlauncher_plugin_url_plugin_name ( ) ;
110110 }
111111
112112 public string GetTranslatedPluginDescription ( )
113113 {
114- return context . API . GetTranslation ( " flowlauncher_plugin_url_plugin_description" ) ;
114+ return Localize . flowlauncher_plugin_url_plugin_description ( ) ;
115115 }
116116 }
117117}
0 commit comments