From fb77d42395352e2bb9f88fc57c168c4c680b17b1 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 13 Dec 2022 19:47:05 +0800 Subject: [PATCH] Make error message translatable --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 6 ++++-- Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 312ea3339..0c9b78ca8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -327,7 +327,8 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var message = $"Failed to open editor for file at {record.FullPath} with Editor {Path.GetFileNameWithoutExtension(editorPath)} at {editorPath}"; + var raw_message = Context.API.GetTranslation("plugin_explorer_openwitheditor_error"); + var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(editorPath), editorPath); LogException(message, e); Context.API.ShowMsgError(message); return false; @@ -358,7 +359,8 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var message = $"Failed to open editor for file at {record.FullPath} with Shell {Path.GetFileNameWithoutExtension(shellPath)} at {shellPath}"; + var raw_message = Context.API.GetTranslation("plugin_explorer_openwithshell_error"); + var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(shellPath), shellPath); LogException(message, e); Context.API.ShowMsgError(message); return false; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index b5501d8e3..d44c67bf0 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -71,7 +71,9 @@ Open containing folder Opens the location that contains the file or folder Open With Editor: + Failed to open file at {0} with Editor {1} at {2} Open With Shell: + Failed to open folder {0} with Shell {1} at {2} Exclude current and sub-directories from Index Search Excluded from Index Search Open Windows Indexing Options @@ -88,7 +90,7 @@ Remove from Quick Access Remove the current {0} from Quick Access Show Windows Context Menu - + Everything SDK Loaded Fail Warning: Everything service is not running