GNOME Bugzilla – Bug 458794
Context support works only for single context on a msgid
Last modified: 2008-07-25 17:55:15 UTC
Context support was actually added to support multiple contexts for the single msgid, but intltool doesn't support that properly for glade files. Also came up in #454894 (gtkbuilder support). Here's the how we can implement it more easily. To not actually change too much logic in intltool-extract, I'd suggest doing something like a trick gettext is doing when generating MO files with msgctxt: separate two strings with the \002 byte, and then split them when used etc. Yes, this means we won't allow \002 to appear in the messages, but it can't appear in MO files either, so I think we are pretty safe.
gettext is using \004, if you want to do the same.
Created attachment 110911 [details] [review] patch for msgctxt support This is based partly on Matthias's patch from bug 454894, but without the gtkbuilder bits. Instead, it adds support for using the "msgctxt" attribute of translatable xml nodes. (The gtkbuilder support could be added back on on top of this if this patch went in.) Maybe there should be a flag for specifying the name of the context attribute instead?
Created attachment 110912 [details] test program test program. make sure to copy in the right intltool-extract and intltool-merge after autogen'ing if you intltoolized from a stock intltool install
ping? This is needed for libgweather so that we can distinguish "Athens, Georgia" from the capital of Greece and the former Soviet Republic, etc.
Can you update your test case and patch to be a single patch, with the test case integrated into the intltool tests we already have. It's fairly simple to do, and there are plenty of examples for doing xml extraction in the current set of tests. The patch itself looks good to me, but the test case needs to be integrated into the intltool tests as well. Thanks for working on this.
Created attachment 115261 [details] [review] updated patch with included test case
Looks great. Thanks. Go ahead and commit.
2008-07-25 Wouter Bolsterlee <wbolster@svn.gnome.org> reviewed by: Rodney Dawes <dobey.pwns@gmail.com> * intltool-extract.in: * intltool-merge.in: * tests/cases/az.po: * tests/cases/fr.po: * tests/selftest.pl.in: Bug 458794 – Context support works only for single context on a msgid. Patch and test case by Dan Winship <danw@gnome.org>.