Skip to content

Commit

Permalink
fix for collection menu item label translation
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Apr 18, 2023
1 parent 47aee42 commit ad14d5f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ private void createBasicAssignmentHolderMenuItems(MainMenuItem mainMenuItem, Pag
DisplayType viewDisplayType = defaultView.getDisplay();

PolyStringType display = WebComponentUtil.getCollectionLabel(viewDisplayType);
if (display != null) {
label = WebComponentUtil.getTranslatedPolyString(display);
if (StringUtils.isNotEmpty(getLabelTranslationKey(display))) {
label = getLabelTranslationKey(display);
}

String iconClass = GuiDisplayTypeUtil.getIconCssClass(viewDisplayType);
Expand All @@ -612,6 +612,13 @@ private void createBasicAssignmentHolderMenuItems(MainMenuItem mainMenuItem, Pag
}
}

private String getLabelTranslationKey(PolyStringType label) {
if (label == null || label.getTranslation() == null) {
return null;
}
return label.getTranslation().getKey();
}

private Class<? extends PageBase> getDetailsPage(PageTypes pageDesc) {
return pageDesc.getDetailsPage();
}
Expand Down

0 comments on commit ad14d5f

Please sign in to comment.