[Top][All Lists]

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

[bug-gettext] XML revisited, and the internal ITS usage

From: Daiki Ueno
Subject: [bug-gettext] XML revisited, and the internal ITS usage
Date: Thu, 26 Jun 2014 18:52:22 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)


Related to https://savannah.gnu.org/bugs/?42615

We have recently added support for a few XML-based file formats
(e.g. GtkBuilder and GSettings) using Expat.  After that, I realized
that there are a number of XML-based file formats waiting for support
(e.g. PolicyKit, AppData, Texinfo XML, ...).  I worry that the number of
hand-written scanners will increase the maintenance cost.

So, I'm thinking if it is feasible to allow users to add/maintain custom
scanners by themselves.  This can be thought as an analogue of Autoconf
macros installed under /usr/share/aclocal, while we will probably use (a
subset of) ITS instead of M4.

The idea is basically:

1. xgettext loads up ITS files from /usr/share/gettext/its/ and
   creates the mappings between an XML namespace and an ITS file.

2. When xgettext sees an XML file as input, check the XML namespace of
   the root element.  If it is found in the mappings, apply the
   corresponding ITS rule and extract translatable strings.


- We will no longer need to write C scanners, tests, and documents by
  hand, for XML-based file formats.
- People don't need to wait for a new gettext release, for a new
  XML-based file format support.


- The initial loading of ITS files can be slow.
- libxml2 will be a hard dependency, for XPath processing.

What do people think?  Shaun, do you see any obstacle to implement this?

Daiki Ueno

reply via email to

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