Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
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.tsindex 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 localizedawait 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', asassert.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 iframediff --git a/dashboard/src/pages/Plugins.tsx b/dashboard/src/pages/Plugins.tsxindex 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?: strclassName="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 {