Bug 154607 - In menu XML files the "menu:label" property should be localizable
Summary: In menu XML files the "menu:label" property should be localizable
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-04 17:28 UTC by Rafael Lima
Modified: 2023-05-09 10:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.