Skip to content

Commit 592b838

Browse files
Fix hard-coded translation
1 parent 422307d commit 592b838

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181

8282
<!-- Dialogs -->
8383
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success">Success</system:String>
84+
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_error">Error</system:String>
8485
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success_message">Successfully disabled this program from displaying in your query</system:String>
8586
<system:String x:Key="flowlauncher_plugin_program_run_as_administrator_not_supported_message">This app is not intended to be run as administrator</system:String>
87+
<system:String x:Key="flowlauncher_plugin_program_run_failed">Unable to run {0}</system:String>
8688

8789
</ResourceDictionary>

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Threading;
66
using System.Threading.Tasks;
77
using System.Windows.Controls;
8+
using Flow.Launcher.Infrastructure;
89
using Flow.Launcher.Infrastructure.Logger;
910
using Flow.Launcher.Infrastructure.Storage;
1011
using Flow.Launcher.Plugin.Program.Programs;
@@ -225,9 +226,9 @@ public static void StartProcess(Func<ProcessStartInfo, Process> runProcess, Proc
225226
}
226227
catch (Exception)
227228
{
228-
var name = "Plugin: Program";
229-
var message = $"Unable to start: {info.FileName}";
230-
Context.API.ShowMsg(name, message, string.Empty);
229+
var title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_error");
230+
var message = string.Format(Context.API.GetTranslation("flowlauncher_plugin_program_run_failed"), info.FileName);
231+
Context.API.ShowMsg(title, string.Format(message, info.FileName), string.Empty);
231232
}
232233
}
233234

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public Result Result(string query, IPublicAPI api)
421421
_ = Task.Run(() => Launch(shouldRunElevated)).ConfigureAwait(false);
422422
if (elevated && !shouldRunElevated)
423423
{
424-
var title = "Plugin: Program";
424+
var title = api.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_error");
425425
var message = api.GetTranslation("flowlauncher_plugin_program_run_as_administrator_not_supported_message");
426426
api.ShowMsg(title, message, string.Empty);
427427
}

0 commit comments

Comments
 (0)