Skip to content

Commit 365dd5e

Browse files
committed
Use translation for constant strings
1 parent 9f63291 commit 365dd5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer">Are you sure you want to restart the computer?</system:String>
6464
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_restart_computer_advanced">Are you sure you want to restart the computer with Advanced Boot Options?</system:String>
6565
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_logoff_computer">Are you sure you want to log off?</system:String>
66+
<system:String x:Key="flowlauncher_plugin_sys_dlgtitle_error">Error</system:String>
67+
<system:String x:Key="flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed">Failed to empty the recycle bin. This might happen if:{0}- A file in the recycle bin is in use{0}- You don't have permission to delete some items{0}Please close any applications that might be using these files and try again.</system:String>
6668

6769
<system:String x:Key="flowlauncher_plugin_sys_command_keyword_setting_window_title">Command Keyword Setting</system:String>
6870
<system:String x:Key="flowlauncher_plugin_sys_custom_command_keyword">Custom Command Keyword</system:String>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,9 @@ private List<Result> Commands(Query query)
338338
var result = PInvoke.SHEmptyRecycleBin(new(), string.Empty, 0);
339339
if (result != HRESULT.S_OK && result != HRESULT.E_UNEXPECTED)
340340
{
341-
_context.API.ShowMsgBox("Failed to empty the recycle bin. This might happen if:\n" +
342-
"- A file in the recycle bin is in use\n" +
343-
"- You don't have permission to delete some items\n" +
344-
"Please close any applications that might be using these files and try again.",
345-
"Error",
341+
_context.API.ShowMsgBox(
342+
string.Format(_context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed"), Environment.NewLine),
343+
_context.API.GetTranslation("flowlauncher_plugin_sys_dlgtitle_error"),
346344
MessageBoxButton.OK, MessageBoxImage.Error);
347345
}
348346

0 commit comments

Comments
 (0)