gnome-games r8468 - trunk/libgames-support
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r8468 - trunk/libgames-support
- Date: Tue, 6 Jan 2009 18:19:35 +0000 (UTC)
Author: chpe
Date: Tue Jan 6 18:19:34 2009
New Revision: 8468
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8468&view=rev
Log:
Fix games_card_get_localised_rank_symbol implementation.
Modified:
trunk/libgames-support/games-card.c
Modified: trunk/libgames-support/games-card.c
==============================================================================
--- trunk/libgames-support/games-card.c (original)
+++ trunk/libgames-support/games-card.c Tue Jan 6 18:19:34 2009
@@ -177,44 +177,47 @@
const char *
games_card_get_localised_rank_symbol (int rank)
{
- static const char ranks[][2] = { "*", "A", "1", "2", "3", "4", "5", "6", "7", "8", "9", "J", "Q", "K", "A" };
-#if 0
-#if !GLIB_CHECK_VERSION (2, 18, 0)
-#define NC_(context, string) (string)
-#endif
- static const char *localised_rank[] = {
+#if GLIB_CHECK_VERSION (2, 18, 0)
+ static const char *ranks[] = {
/* Translators: this is the symbol that's on a Joker card */
- NC_("card:joker", "*"),
+ NC_("card symbol", "JOKER"),
/* Translators: this is the symbol that's on an Ace (1) card */
- NC_("card:ace", "A"),
+ NC_("card symbol", "A"),
/* Translators: this is the symbol that's on a 2 card */
- NC_("card:2", "2"),
+ NC_("card symbol", "2"),
/* Translators: this is the symbol that's on a 3 card */
- NC_("card:3", "3"),
+ NC_("card symbol", "3"),
/* Translators: this is the symbol that's on a 4 card */
- NC_("card:4", "4"),
+ NC_("card symbol", "4"),
/* Translators: this is the symbol that's on a 5 card */
- NC_("card:5", "5"),
+ NC_("card symbol", "5"),
/* Translators: this is the symbol that's on a 6 card */
- NC_("card:6", "6"),
+ NC_("card symbol", "6"),
/* Translators: this is the symbol that's on a 7 card */
- NC_("card:7", "7"),
+ NC_("card symbol", "7"),
/* Translators: this is the symbol that's on a 8 card */
- NC_("card:8", "8"),
+ NC_("card symbol", "8"),
/* Translators: this is the symbol that's on a 9 card */
- NC_("card:9", "9"),
+ NC_("card symbol", "9"),
/* Translators: this is the symbol that's on a Jack card */
- NC_("card:jack", "J"),
+ NC_("card symbol", "J"),
/* Translators: this is the symbol that's on a Queen card */
- NC_("card:queen", "Q"),
+ NC_("card symbol", "Q"),
/* Translators: this is the symbol that's on a King card */
- NC_("card:king", "K"),
+ NC_("card symbol", "K"),
/* Translators: this is the symbol that's on an Ace (1) card */
- NC_("card:ace", "A")
+ NC_("card symbol", "A")
};
-#endif
+
+ g_return_val_if_fail (rank >= GAMES_CARD_JOKER && rank <= GAMES_CARD_ACE_HIGH, NULL);
+
+ return g_dpgettext2 (GETTEXT_PACKAGE, "card symbol", ranks[rank]);
+
+#else
+ static const char ranks[][6] = { "JOKER", "A", "1", "2", "3", "4", "5", "6", "7", "8", "9", "J", "Q", "K", "A" };
g_return_val_if_fail (rank >= GAMES_CARD_JOKER && rank <= GAMES_CARD_ACE_HIGH, NULL);
return ranks[rank];
+#endif /* GLIB >= 2.18.0 */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]