bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xgettext and XML files - extracting strings


From: Bruno Haible
Subject: Re: xgettext and XML files - extracting strings
Date: Fri, 05 May 2023 23:44:32 +0200

Hi Shaun,

> Hi there. itstool maintainer here.

Welcome!

> > But, my point of view is: none of them does not make any of the real
> > work of string extraction. The effective, real, work of string
> > extraction is performed by the binary executable, that is, the
> > "xgettext". So, I think I should firstly learn how the "xgettext"
> > works before deciding to ease the work. Do you agree?
> 
> itstool doesn't actually use xgettext for string extraction. It has its
> own algorithms, based on the W3C Internationalization Tag Set (ITS),
> that it uses to determine what constitutes a translation unit. It uses
> that to create a POT file. You then use gettext and whatever other
> tools you like to handle translations and generate an MO file. itstool
> then handles creating translated XML files form source XML file and the
> MO file.
> 
> We wrote itstool before gettext had real XML support. These days,
> gettext handles XML well, with support for certain ITS data categories.
> For most data-oriented XML formats, gettext does a great job, and
> there's no need to introduce another tool. But for document-oriented
> formats like Mallard, DocBook, and DITA, itstool has some tricks that
> make document translation much nicer.

I'm thinking about mentioning itstool in the GNU gettext documentation.
So far, the information regarding XML is split across several sections
[1][2][3]. Would you please help me enhance the documentation?

- Can Jamenson Espindula's example be done with GNU gettext? Perhaps
  by writing a custom "rule" file?

- Which cases exactly require itstool? You mention certain "ITS data
  categories"; do you mean those that are listed in [2]? Which other
  ITS data categories exist that are needed e.g. for DocBook?

Sorry for the maybe dumb questions; I am unfamiliar with this technology.

Bruno

[1] https://www.gnu.org/software/gettext/manual/html_node/XML.html
[2] 
https://www.gnu.org/software/gettext/manual/html_node/Preparing-ITS-Rules.html
[3] 
https://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html#XML-mode-operations






reply via email to

[Prev in Thread] Current Thread [Next in Thread]