4
4
using System . Globalization ;
5
5
using System . Linq ;
6
6
using System . Runtime . InteropServices ;
7
+ using System . Threading . Tasks ;
7
8
using System . Windows ;
8
9
using Windows . Win32 ;
9
10
using Windows . Win32 . Foundation ;
@@ -206,8 +207,8 @@ private static List<Result> Commands(Query query)
206
207
Action = c =>
207
208
{
208
209
var result = Context . API . ShowMsgBox (
209
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_shutdown_computer" ) ,
210
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_shutdown_computer" ) ,
210
+ Localize . flowlauncher_plugin_sys_dlgtext_shutdown_computer ( ) ,
211
+ Localize . flowlauncher_plugin_sys_shutdown_computer ( ) ,
211
212
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
212
213
213
214
if ( result == MessageBoxResult . Yes )
@@ -227,8 +228,8 @@ private static List<Result> Commands(Query query)
227
228
Action = c =>
228
229
{
229
230
var result = Context . API . ShowMsgBox (
230
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_restart_computer" ) ,
231
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_restart_computer" ) ,
231
+ Localize . flowlauncher_plugin_sys_dlgtext_restart_computer ( ) ,
232
+ Localize . flowlauncher_plugin_sys_restart_computer ( ) ,
232
233
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
233
234
234
235
if ( result == MessageBoxResult . Yes )
@@ -248,8 +249,8 @@ private static List<Result> Commands(Query query)
248
249
Action = c =>
249
250
{
250
251
var result = Context . API . ShowMsgBox (
251
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_restart_computer_advanced" ) ,
252
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_restart_computer" ) ,
252
+ Localize . flowlauncher_plugin_sys_dlgtext_restart_computer_advanced ( ) ,
253
+ Localize . flowlauncher_plugin_sys_restart_computer ( ) ,
253
254
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
254
255
255
256
if ( result == MessageBoxResult . Yes )
@@ -269,8 +270,8 @@ private static List<Result> Commands(Query query)
269
270
Action = c =>
270
271
{
271
272
var result = Context . API . ShowMsgBox (
272
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_logoff_computer" ) ,
273
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_log_off" ) ,
273
+ Localize . flowlauncher_plugin_sys_dlgtext_logoff_computer ( ) ,
274
+ Localize . flowlauncher_plugin_sys_log_off ( ) ,
274
275
MessageBoxButton . YesNo , MessageBoxImage . Warning ) ;
275
276
276
277
if ( result == MessageBoxResult . Yes )
@@ -337,8 +338,8 @@ private static List<Result> Commands(Query query)
337
338
if ( result != HRESULT . S_OK && result != HRESULT . E_UNEXPECTED )
338
339
{
339
340
Context . API . ShowMsgBox (
340
- string . Format ( Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed" ) , Environment . NewLine ) ,
341
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtitle_error" ) ,
341
+ Localize . flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed ( Environment . NewLine ) ,
342
+ Localize . flowlauncher_plugin_sys_dlgtitle_error ( ) ,
342
343
MessageBoxButton . OK , MessageBoxImage . Error ) ;
343
344
}
344
345
@@ -377,8 +378,8 @@ private static List<Result> Commands(Query query)
377
378
Action = c =>
378
379
{
379
380
Context . API . SaveAppAllSettings ( ) ;
380
- Context . API . ShowMsg ( Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtitle_success" ) ,
381
- Context . API . GetTranslation ( " flowlauncher_plugin_sys_dlgtext_all_settings_saved" ) ) ;
381
+ Context . API . ShowMsg ( Localize . flowlauncher_plugin_sys_dlgtitle_success ( ) ,
382
+ Localize . flowlauncher_plugin_sys_dlgtext_all_settings_saved ( ) ) ;
382
383
return true ;
383
384
}
384
385
} ,
@@ -418,10 +419,9 @@ private static List<Result> Commands(Query query)
418
419
419
420
_ = Context . API . ReloadAllPluginData ( ) . ContinueWith ( _ =>
420
421
Context . API . ShowMsg (
421
- Context . API . GetTranslation ( "flowlauncher_plugin_sys_dlgtitle_success" ) ,
422
- Context . API . GetTranslation (
423
- "flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded" ) ) ,
424
- System . Threading . Tasks . TaskScheduler . Current ) ;
422
+ Localize . flowlauncher_plugin_sys_dlgtitle_success ( ) ,
423
+ Localize . flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded ( ) ) ,
424
+ TaskScheduler . Current ) ;
425
425
426
426
return true ;
427
427
}
@@ -514,12 +514,12 @@ private static List<Result> Commands(Query query)
514
514
515
515
public string GetTranslatedPluginTitle ( )
516
516
{
517
- return Context . API . GetTranslation ( " flowlauncher_plugin_sys_plugin_name" ) ;
517
+ return Localize . flowlauncher_plugin_sys_plugin_name ( ) ;
518
518
}
519
519
520
520
public string GetTranslatedPluginDescription ( )
521
521
{
522
- return Context . API . GetTranslation ( " flowlauncher_plugin_sys_plugin_description" ) ;
522
+ return Localize . flowlauncher_plugin_sys_plugin_description ( ) ;
523
523
}
524
524
525
525
public void OnCultureInfoChanged ( CultureInfo _ )
0 commit comments