From 16d70a9c917796dcb25d3ae8bf1eee990f960375 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Mon, 4 Mar 2024 08:53:42 +0100 Subject: [PATCH] Default AddressSourceAdapter should show translated class names in combo box (#45) --- .../addressSourceAdapters/default.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/public/js/document/newsletters/addressSourceAdapters/default.js b/public/js/document/newsletters/addressSourceAdapters/default.js index c76e0de..12d0d06 100644 --- a/public/js/document/newsletters/addressSourceAdapters/default.js +++ b/public/js/document/newsletters/addressSourceAdapters/default.js @@ -45,9 +45,9 @@ pimcore.bundle.newsletter.document.newsletters.addressSourceAdapters.default = C defaults: {labelWidth: 200}, items: [ { - xtype: "combo", - name: "class", - fieldLabel: t("class"), + xtype: 'combo', + name: 'class', + fieldLabel: t('class'), triggerAction: 'all', editable: false, store: new Ext.data.Store({ @@ -60,10 +60,19 @@ pimcore.bundle.newsletter.document.newsletters.addressSourceAdapters.default = C rootProperty: 'data' } }, - fields: ["name"] + fields: [ + 'name', + { + name: 'translatedName', + convert: function(v, rec){ + return t(rec.data.name); + }, + depends : ['name'] + } + ] }), width: 600, - displayField: 'name', + displayField: 'translatedName', valueField: 'name' },{ xtype: "textfield",