[Top][All Lists]

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

Re: [bug-gettext] ITS

From: Daiki Ueno
Subject: Re: [bug-gettext] ITS
Date: Thu, 01 Oct 2015 19:22:48 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Daiki Ueno <address@hidden> 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:

It now has documentation and tests, and supports "translate",
"localization-notes", "elements-within-text", and "preserve-space" data

To see the usability of this feature, I tried to convert the existing
XML scanners (namely Glade, GSettings, AppData) to ITS:

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:

- 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:

and also prepared a Fedora Copr repository for that (builds will be
added there soon):

Daiki Ueno

reply via email to

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