From 592b838f3eafa723f0d888d52ac2b3e578cabfa0 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 29 Nov 2022 18:13:55 +0800 Subject: [PATCH] Fix hard-coded translation --- Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml | 2 ++ Plugins/Flow.Launcher.Plugin.Program/Main.cs | 7 ++++--- Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml index 654322805..700c37046 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml @@ -81,7 +81,9 @@ Success + Error Successfully disabled this program from displaying in your query This app is not intended to be run as administrator + Unable to run {0} \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index feeb8e78a..c94c1dca2 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows.Controls; +using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Plugin.Program.Programs; @@ -225,9 +226,9 @@ namespace Flow.Launcher.Plugin.Program } catch (Exception) { - var name = "Plugin: Program"; - var message = $"Unable to start: {info.FileName}"; - Context.API.ShowMsg(name, message, string.Empty); + var title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_error"); + var message = string.Format(Context.API.GetTranslation("flowlauncher_plugin_program_run_failed"), info.FileName); + Context.API.ShowMsg(title, string.Format(message, info.FileName), string.Empty); } } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs index 8ea5d0c9a..627502ea1 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs @@ -421,7 +421,7 @@ namespace Flow.Launcher.Plugin.Program.Programs _ = Task.Run(() => Launch(shouldRunElevated)).ConfigureAwait(false); if (elevated && !shouldRunElevated) { - var title = "Plugin: Program"; + var title = api.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_error"); var message = api.GetTranslation("flowlauncher_plugin_program_run_as_administrator_not_supported_message"); api.ShowMsg(title, message, string.Empty); }