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 119790 - glib should require ngettext
glib should require ngettext
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 116236
 
 
Reported: 2003-08-13 12:55 UTC by Christian Rose
Modified: 2011-02-18 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Rose 2003-08-13 12:55:59 UTC
As discussed in bug 116236, glib should require ngettext() so that other
applications on top can safely assume that this functionality is present.

Also, a full set of macros such as _(, N_(, L_( in glib are also suggested
in that report.
Comment 1 Matthias Clasen 2003-08-13 13:08:25 UTC
Defining _() and friends in a public GLib header doesn't sound like a 
good idea. While it may work for apps which just need it to call 
gettext(), libraries must use dgettext() and pass their own 
translation domain to it.
Comment 2 Owen Taylor 2003-08-13 13:31:56 UTC
It's premature to require ngettext for GLib-2.4. Maybe for 2.6.

As far as the macros go, one possiblity would be to require
special inclusions of #include <glib/gintl.h> or 
#include <glib/gintl-lib.h>.

(Also, would prevent problems with apps that are already
defining these macros. I don't think we can just make
glib.h suddenly start defining them.)
Comment 3 Jody Goldberg 2003-08-13 14:13:19 UTC
A new header sounds good to me.  All I'm looking for is a way to stop
pulling them in from libgnome that gets them from libbonobo.
Comment 4 Matthias Clasen 2003-08-14 00:31:21 UTC
Owen, what do you expect to change wrt. to ngettext between 2.4 and 2.6 ?
Comment 5 Owen Taylor 2003-08-14 04:15:33 UTC
- Time will pass
- Systems using glibc-2.1 will become less common
- Systems using old non-GNU gettext will become less
  common.

Would it be a disaster to require ngettext for 2.4?
No. Is there any hard and fast rule here? No. But my
gut feeling is that waiting for 2.6 will be less
troublesome than doing it now.
Comment 6 Matthias Clasen 2003-08-14 09:53:07 UTC
Its not that important anyway. Modules which want to use ngettext can


just check the availability by themselves. The main problem is that we 
need to figure out how to deal with the po file compatibility. Its 
easy to redefine N_() to fall back to gettext if ngettext isn't 
available, but we probably need to do some po-file-munging in order to 
make older msgfmts happy. 
Comment 7 Danilo Segan 2004-02-01 20:32:01 UTC
Actually, there's another reason to require ngettext in the glib stack
as well (detected during QA of Serbian translation, so that's why it's
so late detected :): a message which would better look with ngettext.

#: glib/gfileutils.c:393 glib/gfileutils.c:458
#, c-format
msgid "Could not allocate %lu bytes to read file \"%s\""

(This should probably be punted for 2.6 along with the requirement for
ngettext itself)
Comment 8 Matthias Clasen 2004-11-03 07:20:22 UTC
We do this now.