GNOME Bugzilla – Bug 123849
Please use ngettext in gedit
Last modified: 2004-12-22 21:47:04 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.
Created attachment 20466 [details] [review] Patch to use ngettext in gedit where appropriate
Can I freely use ngettext in 2.5 code? Should I add some check in configure.in?
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
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.