Add translations

This commit is contained in:
Jack251970 2025-07-20 12:07:15 +08:00
parent 0682e9bed1
commit 85ffd6024b
2 changed files with 10 additions and 9 deletions

View file

@ -221,9 +221,8 @@ namespace Flow.Launcher.Plugin.Explorer
}
catch (Exception e)
{
var message = $"Fail to delete {record.FullPath}";
LogException(message, e);
Context.API.ShowMsgError(message);
LogException($"Fail to delete {record.FullPath}", e);
Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_delete"), record.FullPath));
return false;
}
@ -265,9 +264,9 @@ namespace Flow.Launcher.Plugin.Explorer
}
catch (FileNotFoundException e)
{
var name = "Plugin: Folder";
var message = $"File not found: {e.Message}";
Context.API.ShowMsgError(name, message);
Context.API.ShowMsgError(
Context.API.GetTranslation("plugin_explorer_plugin_name"),
string.Format(Context.API.GetTranslation("plugin_explorer_file_not_found"), e.Message));
return false;
}
@ -334,9 +333,8 @@ namespace Flow.Launcher.Plugin.Explorer
}
catch (Exception e)
{
var message = $"Fail to open file at {record.FullPath}";
LogException(message, e);
Context.API.ShowMsgError(message);
LogException($"Fail to open file at {record.FullPath}", e);
Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_explorer_fail_to_open"), record.FullPath));
return false;
}

View file

@ -132,6 +132,9 @@
<system:String x:Key="plugin_explorer_show_contextmenu_title">Show Windows Context Menu</system:String>
<system:String x:Key="plugin_explorer_openwith">Open With</system:String>
<system:String x:Key="plugin_explorer_openwith_subtitle">Select a program to open with</system:String>
<system:String x:Key="plugin_explorer_fail_to_delete">Fail to delete {0}</system:String>
<system:String x:Key="plugin_explorer_file_not_found">File not found: {0}</system:String>
<system:String x:Key="plugin_explorer_fail_to_open">Fail to open {0}</system:String>
<!-- Special Results -->
<system:String x:Key="plugin_explorer_diskfreespace">{0} free of {1}</system:String>