How to find where a given string is used in the UI

Hi,

Given a string to be translated, given its tag (comment), how to find
where it is used in the UI (in which menu or dialog box)?
The path UI -> the string in Pootle is easy with the keyID, but, to my
knowledge, there is no easy way to find a keyID in the UI.

What is your strategy to find a given string in the UI?

Best regards.
JBF

Hello Jean-Baptiste

You can try to search the string in this tool:

http://lionss-codeornot.rhcloud.com/

May not be 100% error proof but does give you clues.

regards

Olivier

That won't tell you where it's in the UI :slight_smile: Jean-Baptiste is searching
for the other way round in fact and I've no hint for him other than the
path to the file where sometimes the name gives you some information
about the location like in:
cui/ui/aboutconfigdialog.ui

Cheers
Sophie

Hi,

Hello Jean-Baptiste

You can try to search the string in this tool:

http://lionss-codeornot.rhcloud.com/

May not be 100% error proof but does give you clues.

That won't tell you where it's in the UI :slight_smile: Jean-Baptiste is searching
for the other way round in fact and I've no hint for him other than the
path to the file where sometimes the name gives you some information
about the location like in:
cui/ui/aboutconfigdialog.ui

Indeed.
To find a given string in the LO code I am used to search with
http://opengrok.libreoffice.org/

I wonder if it could be possible to design an extension capable to open
the dialog box or the menu which contains a given keyID.

Best regards.
JBF

Hi,

Given a string to be translated, given its tag (comment), how to find
where it is used in the UI (in which menu or dialog box)?

Look at the context info in pootle - if it is a dialog, the dialog's
filename will be listed

https://translations.documentfoundation.org/fr/libo_ui/translate/svx/uiconfig/ui.po#unit=33752638

→ compressgraphicdialog.ui , and as the path to the po shows in svx/uiconfig

you can open that dialog in
glade /opt/libreofficedev5.2/share/config/soffice.cfg/svx/ui/compressgraphicdialog.ui

That already will give some context and typically is enough to guess
where the function can be accessed from the UI

The path UI -> the string in Pootle is easy with the keyID, but, to my
knowledge, there is no easy way to find a keyID in the UI.

Yes, having just a keyID, it is not possible. To find pootle sting in
UI, it is best to go from pootle context/path info.
If it is in sw or scalc projects, you already have an idea it is in
writer or calc for example.

What is your strategy to find a given string in the UI?

See above. easiest if it is a dialog. If it is not a dialog, look at
surrounding strings, maybe there is something familiar and you can at
least have a rough idea.

* filename of po file → rough idea in what module
* context info/places → more detailed info.

→ if in .ui file → look at the dialog in glade → see string in context

you can also use opengrok http://opengrok.libreoffice.org/ to look
where the string is used, maybe the code then gives you a clear idea
(or course depends on your ability to read a little code).

ciao
Christian

Hi Martin,