Opened 2 years ago

Last modified 8 months ago

#5074 new task

Consider using itstool for localization

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

Description

http://itstool.org/ seems to allow for marking sections immutable, and to also allow for merging multiple XML files into a single PO file.

Both features are interesting from our point of view.

Change History (7)

comment:1 by strk, 2 years ago

As a first test I tried generating the pot file for the introduction.xml with no switches and no configuration (itstool introduction.xml > po/templates/introduction.xml.pot). Few interesting things I saw:

(1) Tags are more informative:

-#. Tag: para
+#. (itstool) path: chapter/para

(2) The ", no-c-format" line isn't added:

 #: introduction.xml:21
-#, no-c-format
 msgid "Project Steering Committee"
 msgstr ""

(3) Line wrapping doesn't seem to be supported:

-msgid ""
-"MVT support, Bug fixing, Performance and stability improvements, GitHub "
-"curation, alignment of PostGIS with PostgreSQL releases"
+msgid "MVT support, Bug fixing, Performance and stability improvements, GitHub curation, alignment of PostGIS with PostgreSQL releases"

(4) itstool seems to be including useless portions of the string in the msgid (I checked and xml2po/po2xml are keeping the link intact):

-msgid "Boundless"
+msgid "<ulink url=\"https://www.boundlessgeo.com\">Boundless</ulink>"

comment:2 by strk, 10 months ago

I've added experimental itstool usage in the docbook5 branch. Another difference I noticed is presence of some tags indicators:

-msgid "This method supports Circular Strings and Curves."
+msgid "<_:inlinemediaobject-1/> This method supports Circular Strings and Curves."

I dunno what are they used for

comment:3 by strk, 8 months ago

Ok this is actually a nice feature of itstool: the untranslatable tags are not fully included in message strings, but just placeholder are, see this string obtained with xml2pot:

"The code is built into a single PostgreSQL extension library called "
"<code>address_standardizer</code> which can be installed with <code>CREATE "
"EXTENSION address_standardizer;</code>. In addition to the "
"address_standardizer extension, a sample data extension called "
"<code>address_standardizer_data_us</code> extensions is built, which "
"contains gaz, lex, and rules tables for US data. This extensions can be "
"installed via: <code>CREATE EXTENSION address_standardizer_data_us;</code>"

Compare to the more succint one obtained with itstool, whereas the <code> blocks are removed:

msgid "The code is built into a single PostgreSQL extension library called <_:code-1/> which can be installed with <_:code-2/>. In addition to the address_standardizer extension, a sample data extension called <_:code-3/> extensions is built, which contains gaz, lex, and rules tables for US data. This extensions can be installed via: <_:code-4/>"

comment:5 by robe, 8 months ago

Owner: changed from robe to strk

comment:6 by robe, 8 months ago

Milestone: PostGIS GEOS

comment:7 by strk, 8 months ago

Milestone: PostGIS GEOSPostGIS Fund Me
Note: See TracTickets for help on using tickets.