Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): localize the plugin config frame title

Yudhi Armyndharis647b49b0053b
diff --git a/dashboard/src/pages/PluginConfigUi.test.ts b/dashboard/src/pages/PluginConfigUi.test.ts
index 47e48dda7..b0b8afc84 100644
--- a/dashboard/src/pages/PluginConfigUi.test.ts
+++ b/dashboard/src/pages/PluginConfigUi.test.ts
@@ -75,7 +75,7 @@ function renderPlugins(): void {
);
}
-test('PluginConfigUi replies to config:get with localized schema and locale', async () => {
+test('PluginConfigUi localizes its frame title and replies to config:get with localized schema and locale', async () => {
// Set the dashboard language so we can verify the schema gets localized
await i18next.changeLanguage('es');
@@ -94,6 +94,7 @@ test('PluginConfigUi replies to config:get with localized schema and locale', as
},
i18n: {
es: {
+ name: 'Mi complemento',
config: {
field1: { title: 'Spanish Title' },
},
@@ -116,6 +117,8 @@ test('PluginConfigUi replies to config:get with localized schema and locale', as
assert.ok(el, 'ConfigUi iframe not found in DOM');
return el;
});
+ // The frame's accessible name follows the localized modal title, not the raw manifest name.
+ assert.equal(iframe.getAttribute('title'), 'Mi complemento', 'iframe title was not localized');
// We spy on the iframe's contentWindow postMessage
// JSDOM creates an empty contentWindow for the iframe
diff --git a/dashboard/src/pages/Plugins.tsx b/dashboard/src/pages/Plugins.tsx
index e2fff3b10..e546a8976 100644
--- a/dashboard/src/pages/Plugins.tsx
+++ b/dashboard/src/pages/Plugins.tsx
@@ -371,7 +371,7 @@ function PluginConfigUi({ plugin, sessionId }: { plugin: Plugin; sessionId?: str
className="plugin-config-ui-frame"
sandbox="allow-scripts"
srcDoc={hardenConfigUiHtml(html)}
- title={plugin.name}
+ title={localizePlugin(plugin, i18n.language).name}
style={{ height: plugin.configUi?.height ?? 600 }}
/>
</>
@@ -818,7 +818,7 @@ export default function Plugins() {
try {
await pluginsApi.uninstall(plugin.id);
refetchAll();
- toast.success(t('plugins.toasts.uninstalled', 'Plugin uninstalled'), plugin.name);
+ toast.success(t('plugins.toasts.uninstalled', 'Plugin uninstalled'), localizePlugin(plugin, i18n.language).name);
} catch (err) {
toast.error(t('plugins.toasts.uninstallFailed', 'Uninstall failed'), err instanceof Error ? err.message : '');
} finally {