GNOME Bugzilla – Bug 326200
[Patch] translations in GtkActionGroup errorneously translate empty strings
Last modified: 2006-01-08 23:25:20 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:
2006-01-08 Matthias Clasen <mclasen@redhat.com> * gtk/gtkactiongroup.c (dgettext_swapped): Don't translate empty strings. (#326200, Christian Stimming)