Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(dashboard): translate plugin status and type labels
Yudhi Armyndharis11f08834403c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1c72d4c1a..9dca16416 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Fixed- The dashboard Chats thread renders an `@<digits>` mention as `@FirstName` when that participant has posted in the loaded thread and their id matches the digits in the body. This covers whatsapp-web.js, where the author id and the mention carry the same digits. On Baileys the author is normalized to the phone number when the lid mapping is known while the body keeps the lid digits, so those mentions stay as WhatsApp sent them, as does any mention of someone who has not posted. The resolved name renders inside its own `<bdi>` element, outside Linkify's `ignoreTags`-respected walk, so a push name can never become a clickable link, however it's spelled. Thanks @TanmayChachra.+- The dashboard Plugins page shows a plugin's status and type in the selected language; they rendered as raw English values (`installed`, `extension`) in every locale.### Documentationdiff --git a/dashboard/src/i18n/locales.test.ts b/dashboard/src/i18n/locales.test.tsindex 3adcc67f3..b2ac40a6e 100644--- a/dashboard/src/i18n/locales.test.ts+++ b/dashboard/src/i18n/locales.test.ts@@ -132,6 +132,31 @@ test('new plugins.* keys carry the expected English copy', () => {assert.equal(i18n.t('plugins.toasts.updateFailed'), 'Update failed');});+// Mirrors the `status` and `type` unions on `Plugin` in services/api.ts. The plugin card renders+// both through these keys; a missing one falls back to the raw English value.+const PLUGIN_STATUSES = ['installed', 'enabled', 'disabled', 'error'];+const PLUGIN_TYPES = ['engine', 'storage', 'queue', 'auth', 'extension'];++test('every plugin status and type label resolves in every locale', () => {+ for (const lng of LOCALE_IDS) {+ for (const [group, values] of [+ ['statuses', PLUGIN_STATUSES],+ ['types', PLUGIN_TYPES],+ ] as const) {+ for (const value of values) {+ const key = `plugins.${group}.${value}`;+ const label = i18n.t(key, { lng });+ assert.ok(+ label && label !== key && label !== value,+ `${lng}: ${key} missing, card would render raw "${value}"`,+ );+ }+ }+ }+ assert.equal(i18n.t('plugins.statuses.installed'), 'Installed');+ assert.equal(i18n.t('plugins.types.extension'), 'Extension');+});+test('sessionStatus.failed and sessionStatus.authenticating resolve in every locale', () => {for (const lng of LOCALE_IDS) {for (const status of ['failed', 'authenticating']) {diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.jsonindex 39cc201c4..d6a6a471b 100644--- a/dashboard/src/i18n/locales/ar.json+++ b/dashboard/src/i18n/locales/ar.json@@ -917,6 +917,19 @@"refresh": "تحديث","builtIn": "مدمج","noDescription": "لا يوجد وصف متاح",+ "statuses": {+ "installed": "مُثبَّتة",+ "enabled": "مُمكَّنة",+ "disabled": "مُعطَّلة",+ "error": "خطأ"+ },+ "types": {+ "engine": "محرك",+ "storage": "تخزين",+ "queue": "قائمة",+ "auth": "مصادقة",+ "extension": "امتداد"+ },"enable": "تمكين","disable": "تعطيل","healthCheck": "فحص الصحة",diff --git a/dashboard/src/i18n/locales/de.json b/dashboard/src/i18n/locales/de.jsonindex 551461ffa..385f4c079 100644--- a/dashboard/src/i18n/locales/de.json+++ b/dashboard/src/i18n/locales/de.json@@ -902,6 +902,19 @@"refresh": "Aktualisieren","builtIn": "Integriert","noDescription": "Keine Beschreibung verfügbar",+ "statuses": {+ "installed": "Installiert",+ "enabled": "Aktiviert",+ "disabled": "Deaktiviert",+ "error": "Fehler"+ },+ "types": {+ "engine": "Engine",+ "storage": "Speicher",+ "queue": "Warteschlange",+ "auth": "Auth",+ "extension": "Erweiterung"+ },"enable": "Aktivieren","disable": "Deaktivieren","healthCheck": "Funktionsprüfung",diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.jsonindex c8dfcd7bb..ff180a203 100644--- a/dashboard/src/i18n/locales/en.json+++ b/dashboard/src/i18n/locales/en.json@@ -902,6 +902,19 @@"refresh": "Refresh","builtIn": "Built-in","noDescription": "No description available",+ "statuses": {+ "installed": "Installed",+ "enabled": "Enabled",+ "disabled": "Disabled",+ "error": "Error"+ },+ "types": {+ "engine": "Engine",+ "storage": "Storage",+ "queue": "Queue",+ "auth": "Auth",+ "extension": "Extension"+ },"enable": "Enable","disable": "Disable","healthCheck": "Health Check",diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.jsonindex 1040c17eb..eac265e42 100644--- a/dashboard/src/i18n/locales/es.json+++ b/dashboard/src/i18n/locales/es.json@@ -902,6 +902,19 @@"refresh": "Actualizar","builtIn": "Integrado","noDescription": "Sin descripción disponible",+ "statuses": {+ "installed": "Instalado",+ "enabled": "Habilitado",+ "disabled": "Deshabilitado",+ "error": "Error"+ },+ "types": {+ "engine": "Motor",+ "storage": "Almacenamiento",+ "queue": "Cola",+ "auth": "Autenticación",+ "extension": "Extensión"+ },"enable": "Habilitar","disable": "Deshabilitar","healthCheck": "Comprobación de salud",diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.jsonindex 99123ae83..60da19910 100644--- a/dashboard/src/i18n/locales/fr.json+++ b/dashboard/src/i18n/locales/fr.json@@ -902,6 +902,19 @@"refresh": "Actualiser","builtIn": "Intégré","noDescription": "Aucune description disponible",+ "statuses": {+ "installed": "Installé",+ "enabled": "Activé",+ "disabled": "Désactivé",+ "error": "Erreur"+ },+ "types": {+ "engine": "Moteur",+ "storage": "Stockage",+ "queue": "File d'attente",+ "auth": "Auth",+ "extension": "Extension"+ },"enable": "Activer","disable": "Désactiver","healthCheck": "Bilan de santé",diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.jsonindex 3cb743693..78b1391b5 100644--- a/dashboard/src/i18n/locales/he.json+++ b/dashboard/src/i18n/locales/he.json@@ -911,6 +911,19 @@"refresh": "רענון","builtIn": "מובנה","noDescription": "אין תיאור זמין",+ "statuses": {+ "installed": "מותקן",+ "enabled": "מופעל",+ "disabled": "מושבת",+ "error": "שגיאה"+ },+ "types": {+ "engine": "מנוע",+ "storage": "אחסון",+ "queue": "תור",+ "auth": "אימות",+ "extension": "הרחבה"+ },"enable": "הפעלה","disable": "השבתה","healthCheck": "בדיקת תקינות",diff --git a/dashboard/src/i18n/locales/hi.json b/dashboard/src/i18n/locales/hi.jsonindex 7eedbc8b9..c0fd309f3 100644--- a/dashboard/src/i18n/locales/hi.json+++ b/dashboard/src/i18n/locales/hi.json@@ -902,6 +902,19 @@"refresh": "रीफ़्रेश करें","builtIn": "अंतर्निहित","noDescription": "कोई विवरण उपलब्ध नहीं",+ "statuses": {+ "installed": "इंस्टॉल किया गया",+ "enabled": "सक्षम",+ "disabled": "अक्षम",+ "error": "त्रुटि"+ },+ "types": {+ "engine": "इंजन",+ "storage": "स्टोरेज",+ "queue": "कतार",+ "auth": "प्रमाणीकरण",+ "extension": "एक्सटेंशन"+ },"enable": "सक्षम करें","disable": "अक्षम करें","healthCheck": "स्वास्थ्य जाँच",diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.jsonindex 660cb6aeb..1643adab9 100644--- a/dashboard/src/i18n/locales/it.json+++ b/dashboard/src/i18n/locales/it.json@@ -902,6 +902,19 @@"refresh": "Aggiorna","builtIn": "Integrato","noDescription": "Nessuna descrizione disponibile",+ "statuses": {+ "installed": "Installato",+ "enabled": "Abilitato",+ "disabled": "Disabilitato",+ "error": "Errore"+ },+ "types": {+ "engine": "Motore",+ "storage": "Archiviazione",+ "queue": "Coda",+ "auth": "Autenticazione",+ "extension": "Estensione"+ },"enable": "Abilita","disable": "Disabilita","healthCheck": "Controllo dello Stato (Health Check)",diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.jsonindex 756ecada3..a053ffb94 100644--- a/dashboard/src/i18n/locales/ko.json+++ b/dashboard/src/i18n/locales/ko.json@@ -902,6 +902,19 @@"refresh": "새로고침","builtIn": "내장","noDescription": "설명 없음",+ "statuses": {+ "installed": "설치됨",+ "enabled": "사용함",+ "disabled": "사용 안 함",+ "error": "오류"+ },+ "types": {+ "engine": "엔진",+ "storage": "스토리지",+ "queue": "큐",+ "auth": "인증",+ "extension": "확장"+ },"enable": "사용","disable": "사용 안 함","healthCheck": "상태 확인",diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.jsonindex 16f0b8556..18de7eb82 100644--- a/dashboard/src/i18n/locales/pt-BR.json+++ b/dashboard/src/i18n/locales/pt-BR.json@@ -902,6 +902,19 @@"refresh": "Atualizar","builtIn": "Integrado","noDescription": "Sem descrição disponível",+ "statuses": {+ "installed": "Instalado",+ "enabled": "Habilitado",+ "disabled": "Desabilitado",+ "error": "Erro"+ },+ "types": {+ "engine": "Motor",+ "storage": "Armazenamento",+ "queue": "Fila",+ "auth": "Autenticação",+ "extension": "Extensão"+ },"enable": "Habilitar","disable": "Desabilitar","healthCheck": "Verificação de saúde",diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.jsonindex c973345e2..e66550fc4 100644--- a/dashboard/src/i18n/locales/te.json+++ b/dashboard/src/i18n/locales/te.json@@ -902,6 +902,19 @@"refresh": "రిఫ్రెష్","builtIn": "ఇన్-బిల్ట్","noDescription": "ఎలాంటి వివరణ అందుబాటులో లేదు",+ "statuses": {+ "installed": "ఇన్స్టాల్ చేయబడింది",+ "enabled": "ప్రారంభించబడింది",+ "disabled": "నిలిపివేయబడింది",+ "error": "లోపం"+ },+ "types": {+ "engine": "ఇంజిన్",+ "storage": "స్టోరేజ్",+ "queue": "క్యూ",+ "auth": "ప్రామాణీకరణ",+ "extension": "ఎక్స్టెన్షన్"+ },"enable": "ప్రారంభించు","disable": "నిలిపివేయి","healthCheck": "హెల్త్ చెక్",diff --git a/dashboard/src/i18n/locales/tr.json b/dashboard/src/i18n/locales/tr.jsonindex bd4fadccc..aaf6fb699 100644--- a/dashboard/src/i18n/locales/tr.json+++ b/dashboard/src/i18n/locales/tr.json@@ -902,6 +902,19 @@"refresh": "Yenile","builtIn": "Dahili","noDescription": "Açıklama bulunmuyor",+ "statuses": {+ "installed": "Yüklü",+ "enabled": "Etkin",+ "disabled": "Devre Dışı",+ "error": "Hata"+ },+ "types": {+ "engine": "Motor",+ "storage": "Depolama",+ "queue": "Kuyruk",+ "auth": "Kimlik Doğrulama",+ "extension": "Uzantı"+ },"enable": "Etkinleştir","disable": "Devre Dışı Bırak","healthCheck": "Sağlık Kontrolü",diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.jsonindex d0f537c6f..10c9cda0d 100644--- a/dashboard/src/i18n/locales/zh-CN.json+++ b/dashboard/src/i18n/locales/zh-CN.json@@ -902,6 +902,19 @@"refresh": "刷新","builtIn": "内置","noDescription": "没有可用描述",+ "statuses": {+ "installed": "已安装",+ "enabled": "已启用",+ "disabled": "已禁用",+ "error": "错误"+ },+ "types": {+ "engine": "引擎",+ "storage": "存储",+ "queue": "队列",+ "auth": "认证",+ "extension": "扩展"+ },"enable": "启用","disable": "禁用","healthCheck": "健康检查",diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.jsonindex 0d59f1247..b490bfa44 100644--- a/dashboard/src/i18n/locales/zh-HK.json+++ b/dashboard/src/i18n/locales/zh-HK.json@@ -902,6 +902,19 @@"refresh": "重新整理","builtIn": "內置","noDescription": "沒有可用描述",+ "statuses": {+ "installed": "已安裝",+ "enabled": "已啟用",+ "disabled": "已停用",+ "error": "錯誤"+ },+ "types": {+ "engine": "引擎",+ "storage": "儲存",+ "queue": "佇列",+ "auth": "認證",+ "extension": "擴充"+ },"enable": "啟用","disable": "停用","healthCheck": "健康檢查",diff --git a/dashboard/src/pages/Plugins.tsx b/dashboard/src/pages/Plugins.tsxindex a69052dac..77e00fbc6 100644--- a/dashboard/src/pages/Plugins.tsx+++ b/dashboard/src/pages/Plugins.tsx@@ -864,7 +864,7 @@ export default function Plugins() {<li key={p.id} className="rail-active-item"><span className="status-dot enabled" /><span className="rail-active-name">{localizePlugin(p, i18n.language).name}</span>- <span className="rail-active-type">{p.type}</span>+ <span className="rail-active-type">{t(`plugins.types.${p.type}`, { defaultValue: p.type })}</span></li>))}</ul>@@ -917,9 +917,13 @@ export default function Plugins() {<div className="plugin-status-row"><div className="plugin-status"><span className={`status-dot ${plugin.status}`} />- <span className="status-text">{plugin.status}</span>+ <span className="status-text">+ {t(`plugins.statuses.${plugin.status}`, { defaultValue: plugin.status })}+ </span></div>- <span className="plugin-type-label">{plugin.type}</span>+ <span className="plugin-type-label">+ {t(`plugins.types.${plugin.type}`, { defaultValue: plugin.type })}+ </span></div>{plugin.error && (