Re: Critical gnome-libs 1.4.1.7 bug + fix



lør, 2002-07-13 kl. 05:14 skrev jgotts linuxsavvy com:
> Another problem with the changes to 1.4.1.7 is that the year is now displayed
> as XX instead of XXXX for the C and en_US locales.  I think the intention of
> the changes were to internationalize the date widget but when I set LANG to fr
> I still get MM/DD/YY.  I think this patch should be reverted completely.  It
> has some good ideas, but it breaks the expected behavior of the widget and it
> appears to be partially implemented.
> 

Does this patch help complete the internationalization?

Cheers
Kjartan
Index: gnome-dateedit.c
===================================================================
RCS file: /cvs/gnome/gnome-libs/libgnomeui/Attic/gnome-dateedit.c,v
retrieving revision 1.30.4.4
diff -u -r1.30.4.4 gnome-dateedit.c
--- gnome-dateedit.c    15 May 2002 22:25:17 -0000      1.30.4.4
+++ gnome-dateedit.c    6 Aug 2002 20:39:56 -0000
@@ -80,7 +80,7 @@
 
        gtk_calendar_get_date (calendar, &year, &month, &day);
 
-       date = g_date_new_dmy (day, month, year);
+       date = g_date_new_dmy (day, month + 1, year);
        g_date_strftime (buffer, sizeof(buffer), "%x", date);
        g_date_free (date);
 
@@ -259,10 +259,7 @@
                mtm->tm_min  = 0;
                hit = g_new (hour_info_t, 1);
 
-               if (gde->flags & GNOME_DATE_EDIT_24_HR)
-                       strftime (buffer, sizeof (buffer), "%H:00", mtm);
-               else
-                       strftime (buffer, sizeof (buffer), "%I:00 %p ", mtm);
+               strftime (buffer, sizeof (buffer), "%X", mtm);
                hit->hour = g_strdup (buffer);
                hit->gde  = gde;
 
@@ -283,10 +280,7 @@
 
                        mtm->tm_min = j;
                        hit = g_new (hour_info_t, 1);
-                       if (gde->flags & GNOME_DATE_EDIT_24_HR)
-                               strftime (buffer, sizeof (buffer), "%H:%M", mtm);
-                       else
-                               strftime (buffer, sizeof (buffer), "%I:%M %p", mtm);
+                       strftime (buffer, sizeof (buffer), "%X", mtm);
                        hit->hour = g_strdup (buffer);
                        hit->gde  = gde;
 
@@ -403,10 +397,7 @@
        gtk_entry_set_text (GTK_ENTRY (gde->date_entry), buffer);
 
        /* Set the time */
-       if (gde->flags & GNOME_DATE_EDIT_24_HR)
-               strftime (buffer, sizeof (buffer), "%H:%M", mytm);
-       else
-               strftime (buffer, sizeof (buffer), "%I:%M %p", mytm);
+       strftime (buffer, sizeof (buffer), "%X", mytm);
        gtk_entry_set_text (GTK_ENTRY (gde->time_entry), buffer);
 }
 



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