There is 1 update, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-280b6330-da28-4c36-b10b-43743f797b40 XWIKI-24784 Open

The macro editor displays the raw parameter feature id as a group heading instead of a translated name

 
View issue   ·   Add comment
 

1 update

 
cid:jira-generated-image-avatar-b0c5e221-b497-4ab9-a0c3-8dede1f7790c Changes by Charpentier Lucas on 02/Sep/26 15:34
 
Description: Some macros group their A macro can declare several parameters as alternatives of one same requirement , so that by annotating them with {{@PropertyFeature}} -- the user has to fill fills in one of several alternatives them . The macro insert/edit dialog shows such a group *feature* as a box with a heading. That heading is never translated: it shows the internal raw feature id of the group , in every language.

h2. Steps to reproduce

# Set the wiki default language to French.
# Edit a page with the WYSIWYG editor.
# Insert the Include macro (Insert > Other Macros > Include).

h2. Actual results

Everything in the dialog is in French
-- "Inclure", "(Obligatoire)", "Paramètres optionnels", "Envoyer" -- except the heading of the required box, which reads {{ {} Reference { }} : the feature id declared by {{IncludeMacroParameters } } . On top of that, the box contains a single field, already labelled "Page", so the heading says nothing the user needs.

The attached screenshot shows this for the Include macro, and for the Office Document Viewer macro once XWIKI-23503 is applied.

!xwiki-macro-feature-heading-proof.png|thumbnail!

h2. Expected results

The heading is translated. Better still, no heading at all when the box holds a single visible
field parameter , since that field parameter already has its own label.
 
 

1 comment

 
cid:jira-generated-image-avatar-b0c5e221-b497-4ab9-a0c3-8dede1f7790c Charpentier Lucas on 02/Sep/26 15:35
 

From what I could see the cause is:

MacroDescriptorUIFactory#createOrGetGroup stores two names on the group node: featureName, the raw feature id, and name, the translation of rendering.macro.<macroId>.group.<groupId>.name. displayGroup in macroEditor.js then picks the raw one for a feature-only group, meaning a feature declared without a companion @PropertyGroup:

// macroEditor.js, displayGroup
let isFeature = groupNode.featureOnly;
let name = (isFeature) ? groupNode.featureName : groupNode.name;

So the translated name is never read for those groups, and adding the rendering.macro.<macroId>.group.<feature>.name key to the macro's own bundle changes nothing – which is the trap for anyone trying to fix this from the macro side. It only works for a named @PropertyGroup, which is why rendering.macro.include.group.stringReference.name exists and is used, while the feature heading above it is not.

Note also that MacroUINodeGroup#getFeatureName() promises "the translated name of the feature" in its javadoc, while the factory stores the raw id in it. Whichever fix is chosen, those two should agree again.