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 123858 - Please use ngettext for handling plurals in Guikachu
Please use ngettext for handling plurals in Guikachu
Status: RESOLVED FIXED
Product: Guikachu
Classification: Deprecated
Component: general
unspecified
Other other
: Normal normal
: ---
Assigned To: ÉRDI Gergõ
ÉRDI Gergõ
Depends on:
Blocks:
 
 
Reported: 2003-10-04 22:04 UTC by Danilo Segan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Danilo Segan 2003-10-04 22:04:15 UTC
(Following paragraphs 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.

A simple code example of code using ngettext:

  g_printf (ngettext ("Found %d file.", "Found %d files.", nbr_of_files),
nbr_of_files);



These are the relevant messages.

#: src/mainwin-io.cc:53
#, c-format
msgid "If you don't save, your work from the last %d days will be lost."

#: src/mainwin-io.cc:57
#, c-format
msgid "If you don't save, your work from the last %d hours will be lost."

#: src/mainwin-io.cc:61
#, c-format
msgid "If you don't save, your work from the last %d minutes will be lost."

#: src/mainwin-io.cc:65
msgid "If you don't save, your work from the last minute will be lost."


This bug applies to both gnome-2-branch and HEAD.
Comment 1 ÉRDI Gergõ 2003-10-12 10:36:29 UTC
Looking at mainwin-io.cc, it's clear that the mentioned strings are
only used when the number of {minutes, hours, days} is more than 1.

Should I use ngettext regardless, in light of languages where there
are more than one plural mode? (e.g., IIRC in Russian you have
different forms for 1, 2, and more than 2 things)
Comment 2 Christian Rose 2003-10-12 10:52:52 UTC
Yes please. As you correctly point out, there are many languages that
use more than one plural for n > 1 and even n >> 1 (expressed as if n
is evenly dividable by this and that number, use this and that plural
form), so using ngettext also for those situations makes as much sense
as for the situations where n can also be 0 or 1.
Comment 3 ÉRDI Gergõ 2004-03-26 07:05:48 UTC
Fixed in 1.3.8