enhancement
major
defect
major
minor
minor
#29738
TL Views: the menu cliques of a toolbar are labelled in English in every language ("More", "View", "Export")
Reported from the Consulting application on 8.0.0-alpha9 (BOS/Consulting #416).
CliqueRegistry registers the three menu cliques with literal English labels:
list.add(new CliqueInfo(CommandCliques.VIEW, 600, ToolbarGroupDisplay.MENU, "View", null)); list.add(new CliqueInfo(CommandCliques.EXPORT, 700, ToolbarGroupDisplay.MENU, "Export", null)); list.add(new CliqueInfo(CommandCliques.MORE, 800, ToolbarGroupDisplay.MENU, "More", "css:bi bi-list"));
The source carries a TODO for it. ToolbarBuilder passes the label to ReactToolbarControl#addGroup, and the client shows it as the accessible name and the tooltip of the menu trigger ("…" for more). In a German session every panel header with a clique="more" command therefore says "More", right beside the toolbar's own overflow trigger, which is translated ("Weitere Aktionen", js.toolbar.overflow).
Expected
The clique labels are resource keys, resolved in the user's language like js.toolbar.overflow.
Solution
The clique of a view command (clique="...") is a free name, but order, display mode, icon and label of the cliques were a closed list hard-coded in Java; an application could neither add a clique with a menu label nor translate the standard ones.
The clique definitions of the React UI become application configuration: a configured service CommandCliqueService (in com.top_logic.layout.view) holds an ordered list of cliques, each with name, display (INLINE / MENU), optional icon and an optional internationalized label:
{{{#!xml <config service-class="com.top_logic.layout.view.command.CommandCliqueService">
<instance>
<cliques>
...
<clique name="more" display="MENU" icon="css:bi bi-list">
<label><en>More</en><de>Mehr</de></label>
</clique>
</cliques>
</instance>
</config> }}}
The position in the list defines the order of the toolbar groups. The standard cliques (create, edit, delete, commit, navigate, view, export, more) are defined in tl-layout-view.conf.config.xml; an application adds own cliques or relabels/reorders the standard ones in its own configuration. A clique not configured at all is still shown inline after the configured ones. The toolbar resolves the label in the user's language for the menu trigger.