Re: Feature proposal: string extracting by RegExp for xgettext

From:

Asgeir Frimannsson

Subject:

Re: Feature proposal: string extracting by RegExp for xgettext

Date:

Fri, 14 Mar 2008 17:53:47 +1000

On Thu, Mar 13, 2008 at 11:00 PM, Bruno Haible <address@hidden> wrote:
> 2) About XML based formats: xgettext supports the GNOME Glade format. Its
> designers soon noticed that a long hardcoded list of localizable tags was
> not a good idea. In Glade 2, therefore, there is an attribute
> translatable="yes"
> which makes it easier to extract the localizable contents.
>
> If you have an XML format of your own and want to produce a PO file from
> it,
> the ideal scripting language for this task is probably XQuery. Less ideal,
> but also possible, is XSLT that produces XLIFF, followed by an XLIFF to PO
> converter [1].
Just on this note, and for once totally unrelated to XLIFF:
There is a recent W3C effort called 'International Tag Set' (ITS) [1], which
aim to create an XML language to specify what parts of an XML document are
localisable.
For example, for Glade XML files, the following ITS descriptor [2] can be
applied to extract/merge translatable features:
<its:rules xmlns:its="http://www.w3.org/2005/11/its&quot; version="1.0">
<!-- ITS rules for Glade 2.0, based on http://glade.gnome.org/glade-2.0.dtd -->
<its:translateRule selector="/glade-interface" translate="no"/>
<its:translateRule selector="//address@hidden'yes']" translate="yes"/>
<its:translateRule selector="//atkaction/@description" translate="yes"/>
<its:locNoteRule selector="//address@hidden'yes']"
locNoteType="description" locNotePointer="@comments"/>
</its:rules>
Support for something like this in gettext would be interesting, and would
allow easier PO-based translation of new XML formats...
Just a thought..
cheers,
asgeir
[1] http://www.w3.org/International/its/
[2] http://www.w3.org/TR/xml-i18n-bp/#glade