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 123849 - Please use ngettext in gedit
Please use ngettext in gedit
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other other
: Normal normal
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks: 116236
 
 
Reported: 2003-10-04 20:55 UTC by Danilo Segan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to use ngettext in gedit where appropriate (1.14 KB, patch)
2003-10-04 20:59 UTC, Danilo Segan
none Details | Review

Description Danilo Segan 2003-10-04 20:55:33 UTC
(Following paragraph copied from bug 116236 verbatim :-)
As mentioned in
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals,
the common way of handling plurals is broken for many locales. A way to solve
this is by using ngettext instead, as mentioned in that document.


This is the relevant messages in Gedit HEAD.
#: gedit/dialogs/gedit-dialog-replace.c:1149
#, c-format
msgid "Found and replaced %d occurrences."

#: gedit/gedit-file.c:732
#, c-format
msgid "Loading %d files..."

I'll attach a patch that fixes this issue.
Comment 1 Danilo Segan 2003-10-04 20:59:09 UTC
Created attachment 20466 [details] [review]
Patch to use ngettext in gedit where appropriate
Comment 2 Paolo Maggi 2003-12-20 10:44:36 UTC
Can I freely use ngettext in 2.5 code? Should I add some check in
configure.in?
Comment 3 Danilo Segan 2003-12-20 19:29:20 UTC
You'd need to check for ngettext function in configure.in, and abandon
configuration if it's not there.

Use something like:
AC_CHECK_FUNCS(ngettext,...)

This will have a side effect that it will fail without "recent" GNU
gettext (0.11 did have it, probably even 0.10.x; current is 0.13.1),
or Solaris 9 (or patched Solaris 8).  If you don't want to require
that "recent" GNU gettext, you might want to check my comments in bug
116236 on how to preprocess files before passing them to old msgfmt,
or you can simply include generated .gmo files in the dist (that's
default for "make dist" afaik).

As a sidenote, I've noticed that gnome-vfs is using ngettext in 2.5.2
and 2.5.3, though there's no check at all.  I didn't hear anyone
complain, so it seems that ngettext is really present on a majority of
systems, what's encouraging :)

Hope this helps
Comment 4 Paolo Maggi 2003-12-29 15:59:14 UTC
Patch committed to CVS HEAD. 
I have added the following check in configure.in

| dnl
| dnl Check ngettext
| dnl
| 
| AC_CHECK_FUNCS(ngettext,, AC_MSG_ERROR([ngettext function is
required to build gedit.]))

Thanks Danilo.