Re: gettext



On Mon, May 16, 2016 at 10:52 PM <philip chimento gmail com> wrote:
On Mon, May 16, 2016 at 4:08 AM Matthias Clasen <matthias clasen gmail com> wrote:
On Mon, May 16, 2016 at 12:36 AM,  <philip chimento gmail com> wrote:

>
>
> I've done some work on this; I rewrote the wiki page titled "Localize using
> Gettext and Intltool" [1] so that it doesn't mention intltool anymore. Since
> it's a pretty drastic revision, I put it in a paste [2], maybe someone wants
> to check if I haven't been too overzealous in deleting?
>
> Furthermore, here's the migration guide [3]. Caveats are that I did this
> mostly by looking back at some commits that I made a few months ago, and
> I've never done it for AppData files, so it could probably use some
> independent verification.

I've briefly looked over the migration guide. Some comments/corrections:

- Current gettext _does_ support its files, and some gnome projects
install their own now: glib installs gschema.its, and gtk+ installs
gtkbuilder.its, etc. The its support may be a 0.19.7 addition.

- There is some unclear information about what file formats require
merging translations back, and which don't: gschema and gtkbuilder
files reference the gettext domain for translation at runtime - you
don't merge translations back into the xml.

Thanks, Matthias. Indeed it is a 0.19.7 feature. I've updated the migration guide and now I'll go update my own project to 0.19.7 to make sure my advice is correct :-P

After trying it out, it's very unfortunate that msgfmt doesn't have an argument allowing you to specify a custom ITS rule; it only detects ones that have been installed into the Gettext data directories. It seems this can be worked around by specifying a local path in the GETTEXTDATADIR(S) environment variables. As I had to find that out by reading the Gettext source, I'm not sure how well it can be relied on; maybe the itstool hack is better if you have to merge translations back.

Also, if you use xgettext's --its option to specify a custom ITS rule, then it seems not to pick up translatable strings from C sources anymore; but without it, it won't pick them up from the XML files. I'll check again tomorrow and otherwise report this as a bug.

I've reverted the last section of the migration guide back to the itstool instructions for now.

Regards,
Philip C


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