From 365dd5ee17baf43a5e00d3720a81b1f048da09b2 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Sun, 20 Jul 2025 09:42:32 +0800
Subject: [PATCH] Use translation for constant strings
---
Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml | 2 ++
Plugins/Flow.Launcher.Plugin.Sys/Main.cs | 8 +++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml
index ad3f8553b..3c8e37b53 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Languages/en.xaml
@@ -63,6 +63,8 @@
Are you sure you want to restart the computer?
Are you sure you want to restart the computer with Advanced Boot Options?
Are you sure you want to log off?
+ Error
+ 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.
Command Keyword Setting
Custom Command Keyword
diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
index 4f44c033f..0b45b1524 100644
--- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs
@@ -338,11 +338,9 @@ namespace Flow.Launcher.Plugin.Sys
var result = PInvoke.SHEmptyRecycleBin(new(), string.Empty, 0);
if (result != HRESULT.S_OK && result != HRESULT.E_UNEXPECTED)
{
- _context.API.ShowMsgBox("Failed to empty the recycle bin. This might happen if:\n" +
- "- A file in the recycle bin is in use\n" +
- "- You don't have permission to delete some items\n" +
- "Please close any applications that might be using these files and try again.",
- "Error",
+ _context.API.ShowMsgBox(
+ string.Format(_context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_empty_recycle_bin_failed"), Environment.NewLine),
+ _context.API.GetTranslation("flowlauncher_plugin_sys_dlgtitle_error"),
MessageBoxButton.OK, MessageBoxImage.Error);
}