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 106697 - Please use ngettext for handling plurals in gnome-games
Please use ngettext for handling plurals in gnome-games
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks: 116236
 
 
Reported: 2003-02-21 10:03 UTC by Christian Rose
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4



Description Christian Rose 2003-02-21 10:03:34 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);
Comment 1 Abel Cheung 2003-04-30 18:55:54 UTC
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.
Comment 2 Callum McKenzie 2003-05-21 23:32:23 UTC
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 ***
Comment 3 Christian Rose 2003-05-21 23:36:06 UTC
Is gnome-games now using ngettext? Otherwise I don't believe this is
resolved.
Comment 4 Callum McKenzie 2003-05-22 02:18:27 UTC
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).
Comment 5 Callum McKenzie 2003-05-22 07:37:23 UTC
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 ***
Comment 6 Christian Rose 2003-05-22 10:42:42 UTC
#: 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).
Comment 7 Callum McKenzie 2003-05-22 12:19:44 UTC
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.
Comment 8 Christian Rose 2003-05-22 19:05:39 UTC
> 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".