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 143336 - gnome-app-helper.h and the N_() macro.
gnome-app-helper.h and the N_() macro.
Status: RESOLVED WONTFIX
Product: libgnomeui
Classification: Deprecated
Component: general
2.4.x
Other All
: Normal major
: future
Assigned To: libgnomeui maintainers
libgnomeui maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-28 15:40 UTC by Onno Kortmann
Modified: 2008-09-16 14:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Onno Kortmann 2004-05-28 15:40:14 UTC
If including gnome-app-helper.h, the N_() macro is undefined. IMHO, either the
docs should mention that or gnome-app-helper should contain something like

#define ENABLE_NLS 1
#include <gnome.h>
Comment 1 Kjartan Maraas 2005-01-10 13:04:04 UTC
#include <gnome.h> is not the right thing since that file is deprecated from 2.x
on IIRC. #include <libgnome/libgnome.h> is probably better?
Comment 2 Kjartan Maraas 2006-10-23 15:38:15 UTC
I added bonobo-i18n.h to get the N_() macro.
Comment 3 Luca Ferretti 2006-10-25 11:07:45 UTC
After this change some modules have started to fail build. This is the make output for slab

#####################
In file included from /opt/gnome2/include/glib-2.0/glib/gi18n.h:23,
                 from app-shell.c:26:
/usr/include/libintl.h:40: error: expected identifier or '(' before 'const'
/usr/include/libintl.h:45: error: expected identifier or '(' before 'const'
/usr/include/libintl.h:52: error: expected identifier or '(' before 'const'
/usr/include/libintl.h:83: error: expected identifier or '(' before 'const'
/usr/include/libintl.h:87: error: expected identifier or '(' before 'const'
/usr/include/libintl.h:92: error: expected identifier or '(' before 'const'
In file included from app-shell.c:26:
/opt/gnome2/include/glib-2.0/glib/gi18n.h:25:1: warning: "_" redefined
In file included from /opt/gnome2/include/libgnomeui-2.0/libgnomeui/gnome-app-helper.h:43,
                 from /opt/gnome2/include/libgnomeui-2.0/libgnomeui/libgnomeui.h:35,
                 from app-shell.c:22:
/opt/gnome2/include/libbonobo-2.0/bonobo/bonobo-i18n.h:69:1: warning: this is the location of the previous definition
make[3]: *** [app-shell.lo] Error 1
make[3]: Leaving directory `/home/luca/cvs/gnome2/slab/libslab'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/luca/cvs/gnome2/slab/libslab'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/luca/cvs/gnome2/slab'
make: *** [all] Error 2
######################################

Another application is NetworkManager.

Both modules provide

   #include <glib/gi18n.h>

in failing C source. 
Comment 4 Christian Persch 2006-11-02 13:33:13 UTC
Confirming the regression; reopening.
Comment 5 Kjartan Maraas 2006-12-03 23:00:34 UTC
I guess we should just define N_() in the header just like we do for D_() and L_()?
Comment 6 Christian Persch 2007-01-08 17:30:15 UTC
Yes, I guess that should work.
Comment 7 Kjartan Maraas 2008-01-08 13:02:06 UTC
Like this?

Index: gnome-app-helper.h
===================================================================
--- gnome-app-helper.h	(revisjon 5485)
+++ gnome-app-helper.h	(arbeidskopi)
@@ -541,9 +541,11 @@
 #ifdef ENABLE_NLS
 #define D_(x) dgettext (GETTEXT_PACKAGE, x)
 #define L_(x) gnome_app_helper_gettext(x)
+#define N_(x) x
 #else
 #define D_(x) x
 #define L_(x) x
+#define N_(x) x
 #endif
Comment 8 Christian Persch 2008-01-08 13:29:50 UTC
Yes.
Comment 9 Kjartan Maraas 2008-09-14 18:45:30 UTC
That made nautilus compile break with a redefinition of N_() from gi18n.h. Adding gi18n-lib.h to gnome-app-helper.h breaks with a message saying that GETTEXT_PACKAGE should be defined before including that... Round and round we go. Any ideas on how to fix this or should we just leave it?
Comment 10 Christian Persch 2008-09-14 22:09:34 UTC
I guess we should just give up on this.
Comment 11 Kjartan Maraas 2008-09-16 14:45:32 UTC
Agreed.