Use translation

This commit is contained in:
Jack251970 2025-09-15 21:38:53 +08:00
parent e204daa844
commit 0355993b00
2 changed files with 6 additions and 3 deletions

View file

@ -219,6 +219,7 @@
<system:String x:Key="failedToUninstallPluginTitle">Fail to uninstall {0}</system:String>
<system:String x:Key="fileNotFoundMessage">Unable to find plugin.json from the extracted zip file, or this path {0} does not exist</system:String>
<system:String x:Key="pluginExistAlreadyMessage">A plugin with the same ID and version already exists, or the version is greater than this downloaded plugin</system:String>
<system:String x:Key="errorCreatingSettingPanel">Error creating setting panel for plugin {0}:{1}{2}</system:String>
<!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">Plugin Store</system:String>

View file

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@ -145,9 +146,10 @@ namespace Flow.Launcher.ViewModel
// We can safely cast here as we already check this in HasSettingControl
return ((ISettingProvider)pair.Plugin).CreateSettingPanel();
}
catch (System.Exception e)
catch (Exception e)
{
var errorMsg = $"Error creating setting panel for plugin {pair.Metadata}\n{e.Message}";
var errorMsg = string.Format(App.API.GetTranslation("errorCreatingSettingPanel"),
pair.Metadata.Name, Environment.NewLine, e.Message);
var grid = new Grid()
{
Margin = SettingPanelMargin