Daiki Ueno <[email protected]> writes: > http://git.savannah.gnu.org/cgit/gettext.git/log/?h=wip/ueno/its
I think the xgettext implementation is almost there. Here is a squashed commit rebased onto the current git master: http://git.sv.gnu.org/cgit/gettext.git/commit/?h=wip/ueno/its2&id=7a17583f It now has documentation and tests, and supports "translate", "localization-notes", "elements-within-text", and "preserve-space" data categories. To see the usability of this feature, I tried to convert the existing XML scanners (namely Glade, GSettings, AppData) to ITS: http://git.sv.gnu.org/cgit/gettext.git/commit/?h=wip/ueno/its2&id=74751001 http://git.sv.gnu.org/cgit/gettext.git/commit/?h=wip/ueno/its2&id=41185040 http://git.sv.gnu.org/cgit/gettext.git/commit/?h=wip/ueno/its2&id=5c7e88e2 While it was straightforward to rewrite the AppData scanner in ITS, I realized that the other formats cannot be handled only with ITS 2.0, because of: - special whitespace normalization rule in GSettings: https://git.gnome.org/browse/glib/tree/gio/gsettingsschema.c#n533 - msgctxt, particularly in the old style format, i.e. "msgctxt|msgid" in Glade 2 files - Glade/GSettings scanners shouldn't escape special characters in XML, since the extracted strings are used in the library (GLib/libglade) as a ordinary string value, rather than an XML fragment To work out those issues, I had to add the following new rules: - gt:preserveSpaceRule, which is same as its:preserveSpaceRule, but it allows space="strip" in addition to "preserve" and "default" - gt:contextRule, which is similar to itst:contextRule used in itstool, but it allows textPointer="..." to strip msgctxt part from msgid - gt:encodeRule, which allows encode="no", to inhibit character escaping I am not really happy with them. Any better ideas would be appreciated. For those interested in testing, I have put the snapshot tarball at: http://du-a.org/~ueno/gettext/gettext-0.19.6.9-7475.tar.xz and also prepared a Fedora Copr repository for that (builds will be added there soon): http://copr.fedoraproject.org/coprs/ueno/gettext-its/ Regards, -- Daiki Ueno
