GNOME Bugzilla – Bug 106697
Please use ngettext for handling plurals in gnome-games
Last modified: 2004-12-22 21:47:04 UTC
#: aisleriot/SCHEME_GAMES.h:11 msgid " " #: aisleriot/SCHEME_GAMES.h:12 msgid " of " #: aisleriot/SCHEME_GAMES.h:13 msgid "'s" #: freecell/src/score.c:80 #, c-format msgid "current: %d wins" #: freecell/src/score.c:82 #, c-format msgid "current: %d losses" #: gtali/cyahtzee.c:548 gtali/gyahtzee.c:117 #, c-format msgid "%s wins the game with %d points" As mentioned in http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals, this 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);
I reported this bug around 2 years ago, and got answer similar to "This bug will be fixed when Aisleriot2 replaces aisleriot". Btw, aisleriot uses scheme, and I don't know if ngettext is usable here.
Gettext has now been made to work with scheme and the cleanups should be occuring in the next week. Marking as a duplicate of bug #50676 *** This bug has been marked as a duplicate of 50676 ***
Is gnome-games now using ngettext? Otherwise I don't believe this is resolved.
I didn't explain it quite right (and I missed the gtali reference). Since freecell is dead (it has been merged into aisleriot) then only the aisleriot and gtali lines are significant. Since I missed the gtali line earlier I assigned this as a duplicate of the aisleriot bug. I'll close this again tonight once I've fixed gtali. Sorry for the confusion (and mistakes).
Gtali is now fixed in CVS. So I'm closing this again since the remaining messages are covered by bug #50676. *** This bug has been marked as a duplicate of 50676 ***
#: same-gnome/same-gnome.c:182 #, c-format msgid "%d stones selected" This one doesn't seem to use ngettext. Please also note that the use of ngettext in GNOME core components is still questionable due to portability reasons, as per discussion on the desktop-devel mailing list (http://mail.gnome.org/archives/desktop-devel-list/2003-February/msg00886.html).
On the ngettext issue, I'm just doing what people tell me. If ngettext has to be removed again it won't be the end of the world. In the case of gtali scores are generally large numbers (and can't be less than five) which as I understand it "only" affects most of Eastern Europe. In the same-gnome case the number is between 2 and twenty-ish and so it avoids the trivial plural case, but none of the others than ngettext was invented for. Anyway, I've fixed same-gnome and I'm going to mark this as fixed again, I'm sure it'll be reopened when its needed.
> In the case of gtali scores are generally large numbers (and can't be > less than five) which as I understand it "only" affects most of > Eastern Europe. In the same-gnome case the number is between 2 and > twenty-ish and so it avoids the trivial plural case, but none of the > others than ngettext was invented for. If you decide to go with ngettext at all, do it all the way. Don't assume that if its big enough numbers it won't be needed -- some languages have really complex rules. E.g. for Polish (quote from http://www.gnu.org/manual/gettext/html_chapter/gettext_10.html#SEC150): "In Polish we use e.g. plik (file) this way: 1 plik 2,3,4 pliki 5-21 pliko'w 22-24 pliki 25-31 pliko'w and so on" So even if the number is big, there is a need for ngettext handling, as the plural form depends on the "last digit".