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 122111 - Add gi18n.h, gi18n-lib.h
Add gi18n.h, gi18n-lib.h
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.2.x
Other Linux
: High normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 97556
 
 
Reported: 2003-09-12 13:16 UTC by Owen Taylor
Modified: 2011-02-18 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gi18n.h (1.50 KB, text/plain)
2003-09-14 22:58 UTC, Matthias Clasen
  Details
gi18n-lib.h (1.54 KB, text/plain)
2003-09-14 22:59 UTC, Matthias Clasen
  Details
glue (2.05 KB, patch)
2003-09-14 22:59 UTC, Matthias Clasen
none Details | Review

Description Owen Taylor 2003-09-12 13:16:47 UTC
To avoid people having to reinvent the _()/N_() wheel, it probably
makes sense to add some functionality for this to GLib.

We can't add _() to glib.h for multiple reasons

 A) It would conflict with people who are already defining
    it themselves.

 B) Different definitions are needed for libraries and applications.

So, my proposal is to add two header files

 #include <glib/gi18n.h>

or:

 #define GETTEXT_PACKAGE "gtk2"
 #include <glib/gi18n-lib.h>

That you include depending on whether you are writing a library
or an application.

(Should we have the glib/ ? We dont' for other glib headers
that you typically include.)
Comment 1 Matthias Clasen 2003-09-14 22:58:05 UTC
Do these look suitable ? I've made them includable via <glib/gi18n.h>
rather than <gi18n.h>, following gprintf.h. Note that the patch also
contains the stuff for bug 97556.
Comment 2 Matthias Clasen 2003-09-14 22:58:42 UTC
Created attachment 19931 [details]
gi18n.h
Comment 3 Matthias Clasen 2003-09-14 22:59:15 UTC
Created attachment 19932 [details]
gi18n-lib.h
Comment 4 Matthias Clasen 2003-09-14 22:59:43 UTC
Created attachment 19933 [details] [review]
glue
Comment 5 Owen Taylor 2003-11-05 16:39:38 UTC
Looks good to me.
Comment 6 Jody Goldberg 2003-11-05 16:50:14 UTC
Amen.  Please lets get this into 2.3.1
Comment 7 Jody Goldberg 2003-11-05 22:07:26 UTC
We should grep around for all the copies
I did a quick search on ifdef gettext_noop

gnome-vfs-extras/gnome-vfs-extras-i18n.h:14:#    ifdef gettext_noop
atk/atk/atkintl.h:9:#ifdef gettext_noop
eel/eel/eel-i18n.h:37:#ifdef gettext_noop
foocanvas/libfoocanvas/foo-canvas-i18n.h:48:#    ifdef gettext_noop
glade/glade/gladeconfig.h:42:#ifdef gettext_noop
glib/glib/glibintl.h:15:#ifdef gettext_noop
gnome-db/frontend/gnome-db.h:33:#    ifdef gettext_noop
gnome-desktop/libgnome-desktop/gnome-desktop-i18n.h:38:#ifdef gettext_noop
gnome-office/libgnomeoffice/go-intl.h:29:#ifdef gettext_noop
gnome-vfs/libgnomevfs/gnome-vfs-i18n.h:9:#    ifdef gettext_noop
gtk+/gdk/gdkintl.h:9:#ifdef gettext_noop
gtk+/gdk-pixbuf/gdk-pixbuf-i18n.h:9:#ifdef gettext_noop
gtk+/gtk/gtkintl.h:9:#ifdef gettext_noop
gtksourceview/gtksourceview/gtksourceview-i18n.h:43:#    ifdef
gettext_noop
libbonobo/bonobo/bonobo-i18n.h:49:#    ifdef gettext_noop
libbonobo/bonobo-activation/bonobo-activation-i18n.h:27:#    ifdef
gettext_noop
libcomprex/libcomprex/internal.h:84:# ifdef gettext_noop
libgda/libgda/gda-intl.h:30:#ifdef gettext_noop
libgnomecanvas/libgnomecanvas/gnome-canvas-i18n.h:48:#    ifdef
gettext_noop
libgnomedb/libgnomedb/gnome-db-i18n.h:49:#    ifdef gettext_noop
libgnomeprint/libgnomeprint/gnome-print-i18n.h:27:#    ifdef gettext_noop
libgnomeprintui/libgnomeprintui/gnome-print-i18n.h:28:#    ifdef
gettext_noop
sodipodi/src/helper/sp-intl.h:22:#ifdef gettext_noop
glade/examples/editor/src/support.h:18:#  ifdef gettext_noop
gnumeric/src/cut-n-paste-code/foocanvas/libfoocanvas/foo-canvas-i18n.h:50:#
   ifdef gettext_noop
libguppi/libguppi/canvas/foocanvas/libfoocanvas/foo-canvas-i18n.h:50:#
   ifdef gettext_noop
Comment 8 Matthias Clasen 2003-11-05 22:15:49 UTC
Since this bug is resolved, I guess you will have to file bugs against
individual components to make this list useful.
Comment 9 Christian Stimming 2003-11-16 12:28:10 UTC
Oops, sorry for my posting to the old bug#97556. But my question is: What is the 
msgid format that these new functions implement? I can't see any immediate 
information about this in the header files. Matthias, could you add some? That 
would be very nice. 
Comment 10 Matthias Clasen 2003-11-16 22:01:17 UTC
We're following the gettext manual here. Everything up to the first
'|' is context. You can find some docs by build the 2.3 api docs, or
look at the source: docs/reference/glib/tmpl/i18n.sgml