	* gtk/gtkcalendar.c (locales_init) (gtk_calendar_class_init)
	(gtk_calendar_init): Move monthname / weekday abbreviation
	initialisation to separate function, and do the initialization in class
	init rather than instance init.
---
 gtk/gtkcalendar.c |  132 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 70 insertions(+), 62 deletions(-)

Index: gtk/gtkcalendar.c
===================================================================
--- gtk/gtkcalendar.c.orig
+++ gtk/gtkcalendar.c
@@ -374,6 +374,74 @@ static char    *default_monthname[12];
 G_DEFINE_TYPE (GtkCalendar, gtk_calendar, GTK_TYPE_WIDGET)
 
 static void
+locales_init (void)
+{
+  gint i;
+  char buffer[255];
+#ifdef G_OS_WIN32
+  wchar_t wbuffer[100];
+#else
+  time_t tmp_time;
+#endif
+
+  if (!default_abbreviated_dayname[0])
+    for (i=0; i<7; i++)
+      {
+#ifndef G_OS_WIN32
+	tmp_time= (i+3)*86400;
+	strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
+	default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+#else
+	if (G_WIN32_HAVE_WIDECHAR_API ())
+	  {
+	    if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
+				 wbuffer, G_N_ELEMENTS (wbuffer)))
+	      default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
+	    else
+	      default_abbreviated_dayname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
+	  }
+	else
+	  {
+	    if (!GetLocaleInfoA (GetThreadLocale (),
+				 (LOCALE_SABBREVDAYNAME1 + (i+6)%7) | LOCALE_USE_CP_ACP,
+				 buffer, G_N_ELEMENTS (buffer)))
+	      default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
+	    else
+	      default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+	  }
+#endif
+      }
+  
+  if (!default_monthname[0])
+    for (i=0; i<12; i++)
+      {
+#ifndef G_OS_WIN32
+	tmp_time=i*2764800;
+	strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
+	default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+#else
+	if (G_WIN32_HAVE_WIDECHAR_API ())
+	  {
+	    if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
+				 wbuffer, G_N_ELEMENTS (wbuffer)))
+	      default_monthname[i] = g_strdup_printf ("(%d)", i);
+	    else
+	      default_monthname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
+	  }
+	else
+	  {
+	    if (!GetLocaleInfoA (GetThreadLocale (),
+				 (LOCALE_SMONTHNAME1 + i) | LOCALE_USE_CP_ACP,
+				 buffer, G_N_ELEMENTS (buffer)))
+	      default_monthname[i] = g_strdup_printf ("(%d)", i);
+	    else
+	      default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
+	  }
+#endif
+      }
+}
+
+static void
 gtk_calendar_class_init (GtkCalendarClass *class)
 {
   GObjectClass   *gobject_class;
@@ -552,6 +620,8 @@ gtk_calendar_class_init (GtkCalendarClas
 		  G_TYPE_NONE, 0);
   
   g_type_class_add_private (gobject_class, sizeof (GtkCalendarPrivate));
+
+  locales_init ();
 }
 
 static void
@@ -561,12 +631,6 @@ gtk_calendar_init (GtkCalendar *calendar
   time_t secs;
   struct tm *tm;
   gint i;
-  char buffer[255];
-#ifdef G_OS_WIN32
-  wchar_t wbuffer[100];
-#else
-  time_t tmp_time;
-#endif
   GtkCalendarPrivate *priv;
   gchar *year_before;
 #ifdef HAVE__NL_TIME_FIRST_WEEKDAY
@@ -584,62 +648,6 @@ gtk_calendar_init (GtkCalendar *calendar
 
   GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
   
-  if (!default_abbreviated_dayname[0])
-    for (i=0; i<7; i++)
-      {
-#ifndef G_OS_WIN32
-	tmp_time= (i+3)*86400;
-	strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
-	default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
-#else
-	if (G_WIN32_HAVE_WIDECHAR_API ())
-	  {
-	    if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SABBREVDAYNAME1 + (i+6)%7,
-				 wbuffer, G_N_ELEMENTS (wbuffer)))
-	      default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
-	    else
-	      default_abbreviated_dayname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
-	  }
-	else
-	  {
-	    if (!GetLocaleInfoA (GetThreadLocale (),
-				 (LOCALE_SABBREVDAYNAME1 + (i+6)%7) | LOCALE_USE_CP_ACP,
-				 buffer, G_N_ELEMENTS (buffer)))
-	      default_abbreviated_dayname[i] = g_strdup_printf ("(%d)", i);
-	    else
-	      default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
-	  }
-#endif
-      }
-  
-  if (!default_monthname[0])
-    for (i=0; i<12; i++)
-      {
-#ifndef G_OS_WIN32
-	tmp_time=i*2764800;
-	strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
-	default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
-#else
-	if (G_WIN32_HAVE_WIDECHAR_API ())
-	  {
-	    if (!GetLocaleInfoW (GetThreadLocale (), LOCALE_SMONTHNAME1 + i,
-				 wbuffer, G_N_ELEMENTS (wbuffer)))
-	      default_monthname[i] = g_strdup_printf ("(%d)", i);
-	    else
-	      default_monthname[i] = g_utf16_to_utf8 (wbuffer, -1, NULL, NULL, NULL);
-	  }
-	else
-	  {
-	    if (!GetLocaleInfoA (GetThreadLocale (),
-				 (LOCALE_SMONTHNAME1 + i) | LOCALE_USE_CP_ACP,
-				 buffer, G_N_ELEMENTS (buffer)))
-	      default_monthname[i] = g_strdup_printf ("(%d)", i);
-	    else
-	      default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
-	  }
-#endif
-      }
-  
   /* Set defaults */
   secs = time (NULL);
   tm = localtime (&secs);
