Skip to content

Commit 85ffd60

Browse files
committed
Add translations
1 parent 0682e9b commit 85ffd60

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
221221
}
222222
catch (Exception e)
223223
{
224-
var message = $"Fail to delete {record.FullPath}";
225-
LogException(message, e);
226-
Context.API.ShowMsgError(message);
224+
LogException($"Fail to delete {record.FullPath}", e);
225+
Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_delete"), record.FullPath));
227226
return false;
228227
}
229228

@@ -265,9 +264,9 @@ public List<Result> LoadContextMenus(Result selectedResult)
265264
}
266265
catch (FileNotFoundException e)
267266
{
268-
var name = "Plugin: Folder";
269-
var message = $"File not found: {e.Message}";
270-
Context.API.ShowMsgError(name, message);
267+
Context.API.ShowMsgError(
268+
Context.API.GetTranslation("plugin_explorer_plugin_name"),
269+
string.Format(Context.API.GetTranslation("plugin_explorer_file_not_found"), e.Message));
271270
return false;
272271
}
273272

@@ -334,9 +333,8 @@ private Result CreateOpenContainingFolderResult(SearchResult record)
334333
}
335334
catch (Exception e)
336335
{
337-
var message = $"Fail to open file at {record.FullPath}";
338-
LogException(message, e);
339-
Context.API.ShowMsgError(message);
336+
LogException($"Fail to open file at {record.FullPath}", e);
337+
Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_open"), record.FullPath));
340338
return false;
341339
}
342340

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
<system:String x:Key="plugin_explorer_show_contextmenu_title">Show Windows Context Menu</system:String>
133133
<system:String x:Key="plugin_explorer_openwith">Open With</system:String>
134134
<system:String x:Key="plugin_explorer_openwith_subtitle">Select a program to open with</system:String>
135+
<system:String x:Key="plugin_explorer_fail_to_delete">Fail to delete {0}</system:String>
136+
<system:String x:Key="plugin_explorer_file_not_found">File not found: {0}</system:String>
137+
<system:String x:Key="plugin_explorer_fail_to_open">Fail to open {0}</system:String>
135138

136139
<!-- Special Results -->
137140
<system:String x:Key="plugin_explorer_diskfreespace">{0} free of {1}</system:String>

0 commit comments

Comments
 (0)