GNOME Bugzilla – Bug 123858
Please use ngettext for handling plurals in Guikachu
Last modified: 2004-12-22 21:47:04 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.
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)
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.
Fixed in 1.3.8