Bug 154607

Summary: In menu XML files the "menu:label" property should be localizable
Product: LibreOffice Reporter: Rafael Lima <rafael.palma.lima>
Component: LocalizationAssignee: Not Assigned <libreoffice-bugs>
Status: UNCONFIRMED ---    
Severity: normal CC: heiko.tietze, ilmari.lauhakangas
Priority: medium    
Version: 7.6.0.0 alpha0+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=108458
Whiteboard:
Crash report or crash signature: Regression By:

Description Rafael Lima 2023-04-04 17:28:54 UTC
This ticket is a spinoff from a discussion in Gerrit while fixing bug 151338.

The XML files used to define menus / popup menus in LibreOffice support a menu:label property, which allows the definition of a custom label instead of showing the command's Label or ContextLabel (as defined in the .xcu file). See:

https://opengrok.libreoffice.org/xref/core/framework/dtd/menubar.dtd

The only problem is that this label wouldn't be picked up for translation. So I would like to propose that these labels become localizable. For that, we would need to create a new property menu:localize in the DTD file (similar to what we already have in help XHP files). However, here menu:localize would be assumed as False if omitted, and labels that are supposed to be translatable would have to be flagged with menu:localize="True". 

This would make it much easier to create menus / popup menus and give names that are specific to certain situations without having to create new Uno commands.

Currently the menu:label property is only used in Math (see code pointer below) to define multiple menu entries that use the same command with a string argument. To the best of my knowledge, the labels here are not translatable.

https://opengrok.libreoffice.org/xref/core/starmath/uiconfig/smath/popupmenu/edit.xml
Comment 1 Buovjaga 2023-04-11 12:53:58 UTC
Comments from Cloph:

15:11:05 <cloph> why two ways to define it? why is the label in xcu not sufficient?
15:13:57 <cloph> (the example with math explicitly sattes that they use labels here because they are not translatable/that anything that should be translated should be done in the xcu instead)
15:15:52 <cloph> apart from that no hard feelings, however not sure whether just label alone will be sufficient/whether a context attribute or similar to uniquely identify the string also would be necessarily, similar to strings in .ui files.