Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.6288
diff -u -p -r1.6288 ChangeLog
--- ChangeLog	10 Jan 2005 18:37:08 -0000	1.6288
+++ ChangeLog	12 Jan 2005 18:58:10 -0000
@@ -1,3 +1,9 @@
+2005-01-12  Vincent Untz  <vincent@vuntz.net>
+
+	* configure.in: check for nl_langinfo()
+	* gtkcalendar.c: (gtk_calendar_init): use nl_langinfo() when it's
+	available to determine first day of week
+
 2005-01-10  Federico Mena Quintero  <federico@ximian.com>
 
 	Fix #162617.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.419
diff -u -p -r1.419 configure.in
--- configure.in	8 Jan 2005 23:47:00 -0000	1.419
+++ configure.in	12 Jan 2005 18:58:11 -0000
@@ -392,7 +392,7 @@ if test "x$enable_rebuilds" = "xyes" && 
 fi
 AC_SUBST(REBUILD)
 
-AC_CHECK_FUNCS(lstat mkstemp flockfile)
+AC_CHECK_FUNCS(lstat mkstemp flockfile nl_langinfo)
 
 # sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
 AC_MSG_CHECKING(for sigsetjmp)
Index: gtk/gtkcalendar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcalendar.c,v
retrieving revision 1.73
diff -u -p -r1.73 gtkcalendar.c
--- gtk/gtkcalendar.c	12 Nov 2004 17:51:58 -0000	1.73
+++ gtk/gtkcalendar.c	12 Jan 2005 18:58:11 -0000
@@ -34,6 +34,9 @@
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#ifdef HAVE_NL_LANGINFO
+#include <langinfo.h>
+#endif
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
@@ -703,6 +706,10 @@ gtk_calendar_init (GtkCalendar *calendar
   else if (strcmp (year_before, "calendar:MY") != 0)
     g_warning ("Whoever translated calendar:MY did so wrongly.\n");
 
+#ifdef HAVE_NL_LANGINFO
+  week_start = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
+  private_data->week_start = *((unsigned char *) week_start) % 7;
+#else
   /* Translate to calendar:week_start:0 if you want Sunday to be the
    * first day of the week to calendar:week_start:1 if you want Monday
    * to be the first day of the week, and so on.
@@ -719,6 +726,7 @@ gtk_calendar_init (GtkCalendar *calendar
       g_warning ("Whoever translated calendar:week_start:0 did so wrongly.\n");
       private_data->week_start = 0;
     }
+#endif
 }
 
 GtkWidget*
