Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected void populateItem(final ListItem<Class<? extends BasePage>> item) {
IdMPage ann = item.getModelObject().getAnnotation(IdMPage.class);

BookmarkablePageLink<Page> link = new BookmarkablePageLink<>("idmPage", item.getModelObject());
link.add(new Label("idmPageLabel", ann.label()));
link.add(new Label("idmPageLabel", getString(ann.label())));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the getString() variant with default, e.g.

getString(ann.label(), null, ann.label())

so it will work even when the actual translation is not available

if (StringUtils.isNotBlank(ann.listEntitlement())) {
MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, ann.listEntitlement());
}
Expand Down Expand Up @@ -226,7 +226,7 @@ protected void populateItem(final ListItem<Class<? extends BasePage>> item) {
AMPage ann = item.getModelObject().getAnnotation(AMPage.class);

BookmarkablePageLink<Page> link = new BookmarkablePageLink<>("amPage", item.getModelObject());
link.add(new Label("amPageLabel", ann.label()));
link.add(new Label("amPageLabel", getString(ann.label())));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

if (StringUtils.isNotBlank(ann.listEntitlement())) {
MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.RENDER, ann.listEntitlement());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ endDelegation=End Delegation
sessionExpiration.header=Session Expiration
sessionExpiration.body=Your session is about to expire. Please select the appropriate option to keep working.
sessionExpiration.extend=Extend

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These labels shall be provided in the same module where the corresponding page is located, e.g. ``client/idm/console/src/main/resources/...forTopology`

The other two labels are useless and should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed labels for SRA and WA.
It seems that the labels are available only via the BasePage properties file. Creating a Topology properties file does not work, possibly because the IdmPages are dynamic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The menu is shown by all pages, which are all inheriting from BasPage, that's why putting the label in BasePage*.properties works.

You can't put it in Topology*.properties because otherwise all other pages will not know how to translate the Topology label.

There should be a way to move the translations with their own module, especially considering ext pages, which are currently not included in this PR but need to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the BasePage.properties file otherwise, the localized label would be visible only on the selected page. For example, the Home page would show the default label, while the Topology page would show the localized label. I think using BasePage is also a logical choice, since we are referring to the menu.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can have a look at Wicket docs and come up with something that actually solves a general issue rather than just enabling the translation of Topology - because this is all that this PR seems to be about, while there is actually room for some serious improvement.

Summarizing:

  1. come up with a solution which allows to plug-in translations for page menu items, whether such pages are idm, am or ext
  2. find a way to leave the labels in the same source module where the page is

Topology=Topology
WA=WA
SRA=SRA
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ fontSize=Taille de la police
sessionExpiration.header=Expiration de la s\u00e9ance
sessionExpiration.body=Votre session va expirer. Veuillez choisir l'option appropri\u00e9e pour continuer \u00e0 travailler.
sessionExpiration.extend=\u00c9tendre

Topology=Topologie
WA=WA
SRA=SRA
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ endDelegation=Termina Delega
sessionExpiration.header=Scadenza della sessione
sessionExpiration.body=La tua sessione sta per scadere. Seleziona l'opzione appropriata per continuare a lavorare.
sessionExpiration.extend=Estendi

Topology=Topologia
WA=WA
SRA=SRA
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ endDelegation=End Delegation
sessionExpiration.header=Session Expiration
sessionExpiration.body=Your session is about to expire. Please select the appropriate option to keep working.
sessionExpiration.extend=Extend

Topology=\u30c8\u30dd\u30ed\u30b8\u30fc
WA=WA
SRA=SRA
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ endDelegation=End Delegation
sessionExpiration.header=Session Expiration
sessionExpiration.body=Your session is about to expire. Please select the appropriate option to keep working.
sessionExpiration.extend=Extend

Topology=Topologia
WA=WA
SRA=SRA
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ endDelegation=End Delegation
sessionExpiration.header=Session Expiration
sessionExpiration.body=Your session is about to expire. Please select the appropriate option to keep working.
sessionExpiration.extend=Extend

Topology=\u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f
WA=WA
SRA=SRA