After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 458794 - Context support works only for single context on a msgid
Context support works only for single context on a msgid
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on:
Blocks: 529057
 
 
Reported: 2007-07-20 21:42 UTC by Danilo Segan
Modified: 2008-07-25 17:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for msgctxt support (6.05 KB, patch)
2008-05-14 17:06 UTC, Dan Winship
none Details | Review
test program (21.06 KB, application/x-compressed-tar)
2008-05-14 17:07 UTC, Dan Winship
  Details
updated patch with included test case (9.68 KB, patch)
2008-07-25 17:46 UTC, Dan Winship
committed Details | Review

Description Danilo Segan 2007-07-20 21:42:27 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.
Comment 1 Matthias Clasen 2007-11-23 17:23:07 UTC
gettext is using \004, if you want to do the same.
Comment 2 Dan Winship 2008-05-14 17:06:03 UTC
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?
Comment 3 Dan Winship 2008-05-14 17:07:28 UTC
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
Comment 4 Dan Winship 2008-07-25 13:02:01 UTC
ping? This is needed for libgweather so that we can distinguish "Athens, Georgia" from the capital of Greece and the former Soviet Republic, etc.
Comment 5 Rodney Dawes 2008-07-25 16:07:19 UTC
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.
Comment 6 Dan Winship 2008-07-25 17:46:24 UTC
Created attachment 115261 [details] [review]
updated patch with included test case
Comment 7 Rodney Dawes 2008-07-25 17:50:38 UTC
Looks great. Thanks. Go ahead and commit.
Comment 8 Wouter Bolsterlee (uws) 2008-07-25 17:55:15 UTC
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>.