Bug 147427 - [NEWHELP] Add localize attribute to Help tree <topic> tag.
Summary: [NEWHELP] Add localize attribute to Help tree <topic> tag.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: New-Help
  Show dependency treegraph
 
Reported: 2022-02-15 00:45 UTC by Olivier Hallot
Modified: 2022-02-15 12:42 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 Olivier Hallot 2022-02-15 00:45:04 UTC
Add localize= attribute to the <topic> tag of the Help contents tree.

localize="[false|true]"

DTD:

<!ELEMENT topic (#PCDATA)> 
<!ATTLIST topic
id CDATA #REQUIRED
localize CDATA #IMPLIED
>

Default is true

Code fragment (telegram channel, Rafael lima)

Indeed it is much more complicated than I expected. It seems the .tree files are processed here:
https://opengrok.libreoffice.org/xref/core/l10ntools/source/treemerge.cxx?r=67478f9d#28

You could try something like:
xmlChar* pLocalize = xmlGetProp(pCurrent, reinterpret_cast<const xmlChar*>("localize"));

if (localize) {
    break;
}

If the property "localize" exists, than nothing needs to be done.
Comment 1 Olivier Hallot 2022-02-15 12:23:43 UTC
to run treex for checking, do the following

~/git/core/bin/run treex -i ~/git/core/helpcontent2/source/auxiliary/sbasic.tree  -o test_tree.pot

where treex is located in workdir/LinkTarget/Executable/treex

and check test_tree.pot. it is a pot file.
Comment 2 Rafael Lima 2022-02-15 12:42:12 UTC
Indeed this is an important new feature that we should have in the l10n tools to avoid sending to translators strings that do not need to be translated.

This is specially the case with Basic command names.