[Goodies-commits] r4819 - in xfce4-datetime-plugin/trunk: . panel-plugin

Diego Ongaro ongardie at xfce.org
Sat May 17 22:55:23 CEST 2008


Author: ongardie
Date: 2008-05-17 20:55:23 +0000 (Sat, 17 May 2008)
New Revision: 4819

Modified:
   xfce4-datetime-plugin/trunk/ChangeLog
   xfce4-datetime-plugin/trunk/panel-plugin/datetime-dialog.c
Log:
Translate strings in combo boxes


Modified: xfce4-datetime-plugin/trunk/ChangeLog
===================================================================
--- xfce4-datetime-plugin/trunk/ChangeLog	2008-05-17 20:55:19 UTC (rev 4818)
+++ xfce4-datetime-plugin/trunk/ChangeLog	2008-05-17 20:55:23 UTC (rev 4819)
@@ -1,4 +1,6 @@
 2008-05-17  Diego Ongaro <ongardie at gmail.com>
+    * panel-plugin/datetime-dialog.c:
+      - translate strings in combo boxes
     * panel-plugin/datetime.c:
       - handle delete event on popup calendar (patch from Mike Massonet)
       - show popup calendar on all workspaces (patch from Mike Massonet)

Modified: xfce4-datetime-plugin/trunk/panel-plugin/datetime-dialog.c
===================================================================
--- xfce4-datetime-plugin/trunk/panel-plugin/datetime-dialog.c	2008-05-17 20:55:19 UTC (rev 4818)
+++ xfce4-datetime-plugin/trunk/panel-plugin/datetime-dialog.c	2008-05-17 20:55:23 UTC (rev 4819)
@@ -345,7 +345,7 @@
   layout_combobox = gtk_combo_box_new_text();
   gtk_box_pack_start(GTK_BOX(hbox), layout_combobox, TRUE, TRUE, 0);
   for(i=0; i < LAYOUT_COUNT; i++)
-    gtk_combo_box_append_text(GTK_COMBO_BOX(layout_combobox), layout_strs[i]);
+    gtk_combo_box_append_text(GTK_COMBO_BOX(layout_combobox), _(layout_strs[i]));
   gtk_combo_box_set_active(GTK_COMBO_BOX(layout_combobox), datetime->layout);
   g_signal_connect(G_OBJECT(layout_combobox), "changed",
       G_CALLBACK(datetime_layout_changed), datetime);
@@ -397,10 +397,17 @@
   gtk_box_pack_start(GTK_BOX(hbox), date_combobox, TRUE, TRUE, 0);
   exampletm = gmtime(&example_time_t);
   for(i=0; i < DATE_FORMAT_COUNT; i++)
-  {  
-    utf8str = datetime_do_utf8strftime(date_format[i], exampletm);
-    gtk_combo_box_append_text(GTK_COMBO_BOX(date_combobox), utf8str);
-    g_free(utf8str);
+  {
+    if(i < DATE_FORMAT_COUNT - 1)
+    {
+      utf8str = datetime_do_utf8strftime(date_format[i], exampletm);
+      gtk_combo_box_append_text(GTK_COMBO_BOX(date_combobox), utf8str);
+      g_free(utf8str);
+    }
+    else
+    {
+      gtk_combo_box_append_text(GTK_COMBO_BOX(date_combobox), _(date_format[i]));
+    }
 
     /* set active 
      * strcmp isn't fast, but it is done only once while opening the dialog 
@@ -477,9 +484,16 @@
   exampletm = gmtime(&example_time_t);
   for(i=0; i < TIME_FORMAT_COUNT; i++)
   {
-    utf8str = datetime_do_utf8strftime(time_format[i], exampletm);
-    gtk_combo_box_append_text(GTK_COMBO_BOX(time_combobox), utf8str);
-    g_free(utf8str);
+    if(i < TIME_FORMAT_COUNT - 1)
+    {
+      utf8str = datetime_do_utf8strftime(time_format[i], exampletm);
+      gtk_combo_box_append_text(GTK_COMBO_BOX(time_combobox), utf8str);
+      g_free(utf8str);
+    }
+    else
+    {
+      gtk_combo_box_append_text(GTK_COMBO_BOX(time_combobox), _(time_format[i]));
+    }
 
     /* set active 
      * strcmp isn't fast, but it is done only once while opening the dialog 




More information about the Goodies-commits mailing list