diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-01-13 19:37:54 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-01-13 19:37:54 +0000 |
commit | 84fcadeb52a16911bc9f387a617d8b622a04aca4 (patch) | |
tree | 4c1328942ea3f8db1beebb6fe5abac666267d087 /gtk/gtkcalendar.c | |
parent | 92363229635b93a3a5c1914336b5d594122e5836 (diff) | |
download | gtk+-84fcadeb52a16911bc9f387a617d8b622a04aca4.tar.gz |
Check for nl_langinfo() Use nl_langinfo() when it's available to determine
2005-01-13 Matthias Clasen <mclasen@redhat.com>
* configure.in: Check for nl_langinfo()
* gtk/gtkcalendar.c: (gtk_calendar_init): Use nl_langinfo() when it's
available to determine first day of week (#163842, Vincent Untz)
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index d048025ae2..0f45c04041 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -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"); +#if defined (HAVE_NL_LANGINFO) && defined (_NL_TIME_FIRST_WEEKDAY) + 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* |