gnome-games r8551 - trunk/mahjongg



Author: chpe
Date: Sat Jan 10 15:35:52 2009
New Revision: 8551
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8551&view=rev

Log:
Bug 567103 â Migrate gnome-games to use msgctxt

Modified:
   trunk/mahjongg/get_titles.pl
   trunk/mahjongg/mahjongg.c
   trunk/mahjongg/maps.c
   trunk/mahjongg/translatable_game_names.h

Modified: trunk/mahjongg/get_titles.pl
==============================================================================
--- trunk/mahjongg/get_titles.pl	(original)
+++ trunk/mahjongg/get_titles.pl	Sat Jan 10 15:35:52 2009
@@ -36,6 +36,6 @@
 
 while (<FH>) {
   if (/map name=\"(.+?)\"/) { # Let's not even pretend this can read XML.
-    print OUTFILE "gchar *s = N_(\"$1\")\n";
+    print OUTFILE "NC_(\"mahjongg map name\", \"$1\")\n";
   }
 }

Modified: trunk/mahjongg/mahjongg.c
==============================================================================
--- trunk/mahjongg/mahjongg.c	(original)
+++ trunk/mahjongg/mahjongg.c	Sat Jan 10 15:35:52 2009
@@ -1359,7 +1359,10 @@
                                  GAMES_SCORES_STYLE_TIME_ASCENDING);
 
   for (i = 0; i < nmaps; i++) {
-    games_scores_add_category (highscores, maps[i].score_name, maps[i].name);
+    const char *display_name;
+
+    display_name = g_dpgettext2 (NULL, "mahjongg map name", maps[i].name);
+    games_scores_add_category (highscores, maps[i].score_name, display_name);
   }
 }
 

Modified: trunk/mahjongg/maps.c
==============================================================================
--- trunk/mahjongg/maps.c	(original)
+++ trunk/mahjongg/maps.c	Sat Jan 10 15:35:52 2009
@@ -226,11 +226,10 @@
 };
 
 map hardcoded[] = {
-  {N_("mahjongg|Easy"), "easy", easy_map, TRUE, 0, 0}
+  { NC_("mahjongg map name", "Easy"), "easy", easy_map, TRUE, 0, 0}
   ,
 };
 
-
 GList *maplist;
 
 #define TAG_NAME_MAHJONGG "mahjongg"
@@ -563,8 +562,7 @@
 
   /* FIXME: Ideally we would do this transformation, but the old code 
    * expects an array, so we give it one. */
-  if (maps)
-    g_free (maps);
+  g_free (maps);
 
   nmaps = g_list_length (maplist);
 
@@ -577,5 +575,4 @@
       g_free (maplist->data);
     maplist = g_list_delete_link (maplist, maplist);
   }
-
 }

Modified: trunk/mahjongg/translatable_game_names.h
==============================================================================
--- trunk/mahjongg/translatable_game_names.h	(original)
+++ trunk/mahjongg/translatable_game_names.h	Sat Jan 10 15:35:52 2009
@@ -3,11 +3,11 @@
  * Add this file to your project's POTFILES.in.
  * DO NOT compile it as part of your application.
  */
-gchar *s = N_("The Ziggurat")
-  gchar * s = N_("Four Bridges")
-  gchar * s = N_("Cloud")
-  gchar * s = N_("Tic-Tac-Toe")
-  gchar * s = N_("Red Dragon")
-  gchar * s = N_("Pyramid's Walls")
-  gchar * s = N_("Confounding Cross")
-  gchar * s = N_("Difficult")
+NC_("mahjongg map name", "The Ziggurat")
+NC_("mahjongg map name", "Four Bridges")
+NC_("mahjongg map name", "Cloud")
+NC_("mahjongg map name", "Tic-Tac-Toe")
+NC_("mahjongg map name", "Red Dragon")
+NC_("mahjongg map name", "Pyramid's Walls")
+NC_("mahjongg map name", "Confounding Cross")
+NC_("mahjongg map name", "Difficult")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]