[gnome-games] libgames-support: Add translation context for the scores dialog



commit d47b87d54db067545a6e0e39d2b40f5e88d19245
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Feb 27 16:00:20 2012 +1100

    libgames-support: Add translation context for the scores dialog

 libgames-support/games-scores-dialog.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/libgames-support/games-scores-dialog.c b/libgames-support/games-scores-dialog.c
index 0e97f82..4551a17 100644
--- a/libgames-support/games-scores-dialog.c
+++ b/libgames-support/games-scores-dialog.c
@@ -123,8 +123,7 @@ static void games_scores_dialog_load_categories (GamesScoresCategory *cat,
  * is at this layer.
  *
  **/
-static void games_scores_dialog_set_style (GamesScoresDialog *self, 
-					   GamesScoreStyle style) 
+static void games_scores_dialog_set_style (GamesScoresDialog *self, GamesScoreStyle style) 
 {
   const gchar *header;
 
@@ -132,12 +131,14 @@ static void games_scores_dialog_set_style (GamesScoresDialog *self,
   switch (style) {
   case GAMES_SCORES_STYLE_TIME_DESCENDING:
   case GAMES_SCORES_STYLE_TIME_ASCENDING:
-    header = _("Time");
+    /* Score dialog column header for the score time (e.g. 1 minute) */
+    header = C_("score-dialog", "Time");
     break;
   case GAMES_SCORES_STYLE_PLAIN_DESCENDING:
   case GAMES_SCORES_STYLE_PLAIN_ASCENDING:
   default:
-    header = _("Score");
+    /* Score dialog column header for the score value (e.g. 30 moves) */
+    header = C_("score-dialog", "Score");
   }
 
   gtk_tree_view_column_set_title (self->priv->column, header);
@@ -294,8 +295,9 @@ static void games_scores_dialog_redraw (GamesScoresDialog *self) {
     case GAMES_SCORES_STYLE_TIME_DESCENDING:
       dscore = games_score_get_value_as_time ((GamesScore *)scorelist->data);
       score = (int) (100.0 * dscore + 0.5);
-      /* Translators: this is for a minutes, seconds time display. */
-      ss = g_strdup_printf (_("%dm %ds"), score/100, score%100);
+      ss = g_strdup_printf (/* Score format for time based scores.  %1$d is the time in minutes, %2$d is the time in seconds */
+                            C_("score-dialog", "%1$dm %2$ds"),
+                            score/100, score%100);
       break; 
     case GAMES_SCORES_STYLE_PLAIN_ASCENDING:
     case GAMES_SCORES_STYLE_PLAIN_DESCENDING:
@@ -554,18 +556,15 @@ static void games_scores_dialog_init (GamesScoresDialog *self)
   g_signal_connect (self->priv->namerenderer, "edited", 
 		      G_CALLBACK (games_scores_dialog_name_edited), self);
 
-  self->priv->namecolumn = gtk_tree_view_column_new_with_attributes (_("Name"),
-									self->priv->namerenderer,
-									"text", 0,
-									NULL);
+  self->priv->namecolumn = gtk_tree_view_column_new_with_attributes (/* Score dialog column header for the name of the player who recorded the score */
+                                                                     C_("score-dialog", "Name"),
+                                                                     self->priv->namerenderer,
+                                                                     "text", 0,
+                                                                     NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (listview),
 				 GTK_TREE_VIEW_COLUMN (self->priv->namecolumn));
   renderer = gtk_cell_renderer_text_new ();
-  /* Note that this assumes the default style is plain. */
-  column = gtk_tree_view_column_new_with_attributes (_("Score"),
-						       renderer,
-						       "text", 1,
-						       NULL);
+  column = gtk_tree_view_column_new_with_attributes ("", renderer, "text", 1, NULL);
   g_object_set (G_OBJECT (renderer), "xalign", 1.0, NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (listview),
 				 GTK_TREE_VIEW_COLUMN (column));



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