[MGNLUI-4346] ContextMenu item label in Pulse cannot be translated Created: 12/Jan/18  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Jaroslav Simak Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2018-01-12 at 14.58.07.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

The info.magnolia.ui.admincentral.shellapp.pulse.item.list.footer.PulseListFooterViewImpl which is responsible for creating context menu items sets wrong label.

@Override
    public void addAction(String actionId, String label, String icon) {
        ExternalResource iconFontResource = new ExternalResource(ActionPopup.ICON_FONT_CODE + icon);
        final MenuItem menuItem = contextMenu.addItem(label, iconFontResource, new Menu.Command() {
            @Override
            public void menuSelected(MenuItem selectedItem) {
                String eventActionName = selectedItem.getText();
                if (listener != null) {
                    listener.onBulkActionTriggered(eventActionName);
                }

            }
        });
        // Set data variable so that the event handler can determine which action to launch.
        menuItem.setText(actionId);
        menuItems.put(actionId, menuItem);
    }

Problematic part is menuItem.setText(actionId);. ActionId is set as text, which overrides caption passed to the #addItem method. Moreover this line should not be needed at all, because label is set within the #addItem method.

See attached screenshot.


Generated at Mon Feb 12 09:15:44 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.