Hi, 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. Pros: - 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. Cons: - 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? Regards, -- Daiki Ueno
