[monkey-bubble: 100/753] changed gnome-scores to sue strftime for dates, so they can be localized.



commit a1e28312baa65e1ed9e2a2bf041545abd82c45ab
Author: Pablo Saratxaga <pablo src gnome org>
Date:   Mon Aug 16 14:10:44 1999 +0000

    changed gnome-scores to sue strftime for dates, so they can be
    localized.

 libgnomeui/gnome-scores.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/libgnomeui/gnome-scores.c b/libgnomeui/gnome-scores.c
index a37daf3..900bf9c 100644
--- a/libgnomeui/gnome-scores.c
+++ b/libgnomeui/gnome-scores.c
@@ -68,7 +68,7 @@ gnome_scores_new (  guint n_scores,
 	GtkTable	*table;
 	GtkWidget	*label;
 	gchar     	tmp[10];
-	gchar     	*tmp2;
+	gchar     	tmp2[20];
 	guint i;
 	const gchar * buttons[] = { GNOME_STOCK_BUTTON_OK, NULL };
 
@@ -108,7 +108,16 @@ gnome_scores_new (  guint n_scores,
 		gtk_widget_show ( gs->label_scores[i] );
 		gtk_table_attach_defaults ( table, gs->label_scores[i], 1, 2, i+1, i+2);
 
-		tmp2 = ctime( &(times[i]) );
+		/* the localized string should fit (after replacing the %a %b
+		   etc) in ~18 chars; so drop some if needed; after all this
+		   is for games scores, there is no need for extra precision.
+		   %a is abbreviated weekday, %A is full weekday,
+		   %b %B are abbreviated and full monthname, %Y is year,
+		   %d is day of month, %m is month number, %T full hour,
+		   %H hours, %M minutes, %S seconds
+		*/
+		strftime(tmp2,sizeof(tmp2),_("%a %b %d %T %Y"),
+			 localtime( &(times[i]) ));
 		tmp2[strlen(tmp2)-1]=0;
 		gs->label_times[i] = gtk_label_new ( tmp2 );
 		gtk_widget_show ( gs->label_times[i] );



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