Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#5440 closed defect (fixed)

Remove ability to translate some portions of manual

Reported by: strk Owned by: robe
Priority: medium Milestone: PostGIS Fund Me
Component: l18n Version: master
Keywords: Cc:

Description

Things tend to break when translators translate too much. Some things should not be translatable. Function synopsis is one of these things.

There is also some support at the weblate level to make specific strings untranslatable, which would also be good to use, but I'm not sure how to do that programmatically.

For funcsynopsis tags we migth be able to filter those tags out BEFORE calling xml2pot

Change History (10)

comment:1 by Sandro Santilli <strk@…>, 16 months ago

In 2e149c7/git:

[de] Fix ST_Collect synopsis translation

References #5440

comment:2 by strk, 16 months ago

A possible good candidate, although it would introduce a new dependency:

xmlstarlet - command line XML toolkit

Using XSLT would require having all entities defined

comment:3 by strk, 16 months ago

Same problem with xmlstarlet:

xmlstarlet ed -d '//funcsynopsis' reference_output.xml
[..]
reference_output.xml:1739.20: Entity 'Z_support' not defined
                <para>&Z_support;</para>
                                 ^

comment:5 by strk, 16 months ago

We have some occurrences of <programlisting> inside <para>, which make them mixed with text we do want to translate in the template file. To get a list:

grep -l '<programlisting>' doc/po/templates/*.pot

comment:6 by strk, 16 months ago

I'd try to move to xgettext to extract text and ITS rules to mark untranslatable snippets:

https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html#Preparing-ITS-Rules

See also #5074

comment:7 by strk, 16 months ago

xgettext, like itstool, also suffers use of entities:

xgettext --its postgis.its administration.xml 
xgettext: cannot read administration.xml: Entity 'last_release_version' not defined

I guess we'd better wait to migrate all our manual to docbook5 to better deal with localization.

comment:8 by strk, 16 months ago

Another option I was thinking would be we strip blocks of lines in .pot file starting whith #. Tag: programlisting and ending on blank line or end of file

comment:9 by Sandro Santilli <strk@…>, 16 months ago

Resolution: fixed
Status: newclosed

In 109084be/git:

Skip translation of some xml tags

For now we skip these tags:

  • programlisting
  • screen
  • funcsynopsis

Closes #5440

comment:10 by strk, 16 months ago

We still have some programlisting in para, which I think we should remove. See also https://github.com/asciidoctor/docbookrx/issues/41#issuecomment-222571929

Note: See TracTickets for help on using tickets.