Skip to content

Commit fb77d42

Browse files
Make error message translatable
1 parent 0227b95 commit fb77d42

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ private Result CreateOpenWithEditorResult(SearchResult record)
327327
}
328328
catch (Exception e)
329329
{
330-
var message = $"Failed to open editor for file at {record.FullPath} with Editor {Path.GetFileNameWithoutExtension(editorPath)} at {editorPath}";
330+
var raw_message = Context.API.GetTranslation("plugin_explorer_openwitheditor_error");
331+
var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(editorPath), editorPath);
331332
LogException(message, e);
332333
Context.API.ShowMsgError(message);
333334
return false;
@@ -358,7 +359,8 @@ private Result CreateOpenWithShellResult(SearchResult record)
358359
}
359360
catch (Exception e)
360361
{
361-
var message = $"Failed to open editor for file at {record.FullPath} with Shell {Path.GetFileNameWithoutExtension(shellPath)} at {shellPath}";
362+
var raw_message = Context.API.GetTranslation("plugin_explorer_openwithshell_error");
363+
var message = string.Format(raw_message, record.FullPath, Path.GetFileNameWithoutExtension(shellPath), shellPath);
362364
LogException(message, e);
363365
Context.API.ShowMsgError(message);
364366
return false;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
<system:String x:Key="plugin_explorer_opencontainingfolder">Open containing folder</system:String>
7272
<system:String x:Key="plugin_explorer_opencontainingfolder_subtitle">Opens the location that contains the file or folder</system:String>
7373
<system:String x:Key="plugin_explorer_openwitheditor">Open With Editor:</system:String>
74+
<system:String x:Key="plugin_explorer_openwitheditor_error">Failed to open file at {0} with Editor {1} at {2}</system:String>
7475
<system:String x:Key="plugin_explorer_openwithshell">Open With Shell:</system:String>
76+
<system:String x:Key="plugin_explorer_openwithshell_error">Failed to open folder {0} with Shell {1} at {2}</system:String>
7577
<system:String x:Key="plugin_explorer_excludefromindexsearch">Exclude current and sub-directories from Index Search</system:String>
7678
<system:String x:Key="plugin_explorer_excludedfromindexsearch_msg">Excluded from Index Search</system:String>
7779
<system:String x:Key="plugin_explorer_openindexingoptions">Open Windows Indexing Options</system:String>
@@ -88,7 +90,7 @@
8890
<system:String x:Key="plugin_explorer_remove_from_quickaccess_title">Remove from Quick Access</system:String>
8991
<system:String x:Key="plugin_explorer_remove_from_quickaccess_subtitle">Remove the current {0} from Quick Access</system:String>
9092
<system:String x:Key="plugin_explorer_show_contextmenu_title">Show Windows Context Menu</system:String>
91-
93+
9294
<!-- Everything -->
9395
<system:String x:Key="flowlauncher_plugin_everything_sdk_issue">Everything SDK Loaded Fail</system:String>
9496
<system:String x:Key="flowlauncher_plugin_everything_is_not_running">Warning: Everything service is not running</system:String>

0 commit comments

Comments
 (0)