Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-4346

ContextMenu item label in Pulse cannot be translated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • None
    • None
    • None

    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.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              jsimak Jaroslav Simak
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD