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 326200 - [Patch] translations in GtkActionGroup errorneously translate empty strings
[Patch] translations in GtkActionGroup errorneously translate empty strings
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: UIManager / Actions
2.8.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-01-08 13:50 UTC by Christian Stimming
Modified: 2006-01-08 23:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Christian Stimming 2006-01-08 13:50:13 UTC
Please describe the problem:
If the tooltip of a GtkAction is set to the empty string "" as opposed to NULL,
then this empty string is passed through gettext(). On at least some versions of
gettext (at least my gettext-0.14.1) this will errorneously return the large
"Project-Id-Version..." string that exists at the top of every po file.


To fix this, the dgettext_swapped() helper function in gtk/gtkactiongroup.c
should pass the msgid through gettext() only if msgid is nonempty. I've verified
in my local application that this fixes the problem. Patch below. Thanks a lot.

--- gtkactiongroup.c~   2005-05-02 15:57:17.000000000 +0200
+++ gtkactiongroup.c    2006-01-08 14:48:30.000000000 +0100
@@ -1025,7 +1025,8 @@
 dgettext_swapped (const gchar *msgid,
                  const gchar *domainname)
 {
-  return dgettext (domainname, msgid);
+  /* Pass through dgettext if and only if msgid is nonempty. */
+  return (msgid && *msgid) ? dgettext (domainname, msgid) : (gchar*) msgid;
 }

 /**


Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Matthias Clasen 2006-01-08 23:25:20 UTC
2006-01-08  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkactiongroup.c (dgettext_swapped): Don't translate
        empty strings.  (#326200, Christian Stimming)