Index: e-util/ChangeLog
===================================================================
--- e-util/ChangeLog	(revision 34396)
+++ e-util/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #392747
+
+	* e-util.h: (e_utf8_weekday_abbreviations):
+	* e-util.c: (e_utf8_weekday_abbreviations):
+	New helper function to get localized abbreviations of week day names.
+
 2007-10-12  Michael Monreal <michael.monreal@gmail.com>
 
 	** Migration of theme icons to data/icons/ (bug #479257)
Index: e-util/e-util.c
===================================================================
--- e-util/e-util.c	(revision 34396)
+++ e-util/e-util.c	(working copy)
@@ -912,3 +912,75 @@
 	return (uri);
 }
 
+/**
+ * e_utf8_weekday_abbreviations
+ * Fills array abbrs with abbreviations of each week day, returned by strftime,
+ * encoded in utf-8. Days are there stored from Monday to Sunday.
+ * These abbreviations are newly allocated, so free them with g_free.
+ * @param abbrs [out] Abbreviation for each day.
+ **/
+void
+e_utf8_weekday_abbreviations (gchar *abbrs[7])
+{
+	int i, j, len;
+	struct tm ttm;
+	char buff [50 + 1];
+	gboolean same;
+
+	memset (&ttm, 0, sizeof(struct tm));
+	ttm.tm_hour = 12; /* noon */
+	ttm.tm_mday = 15; /* monday */
+	ttm.tm_mon  =  9; /* october */
+	ttm.tm_year = 2007 - 1900;
+	ttm.tm_wday = 1;  /* monday first */
+
+	for (i = 0; i < 7; i++) {
+		e_utf8_strftime (buff, 50, "%a", &ttm);
+		abbrs[i] = g_strdup (buff);
+
+		ttm.tm_mday++;
+		ttm.tm_wday = (ttm.tm_wday + 1) % 7;
+	}
+
+	/* do it as short as possible */
+	same = TRUE;
+	for (len = 0; same && len < 3; len++) {
+		same = FALSE;
+
+		for (i = 0; i < 7 && !same; i++) {
+			gchar *p = abbrs [i];
+			gunichar v;
+
+			p = g_utf8_offset_to_pointer (p, len - 1);
+			v = p ? g_utf8_get_char (p) : 0;
+
+			if (!v)
+				continue;
+
+			for (j = 0; j < 7 && !same; j++) {
+				gchar *q = abbrs [j];
+				gunichar u;
+
+				if (i == j)
+					continue;
+
+				q = g_utf8_offset_to_pointer (q, len - 1);
+				u = q ? g_utf8_get_char (q) : 0;
+
+				same = u == v && u != 0 && v != 0;
+			}
+		}
+	}
+
+	if (!same) {
+		/* we found a unique character on position 'len - 1', so cut it there */
+		gchar *p;
+
+		for (i = 0; i < 7; i++) {
+			p = g_utf8_offset_to_pointer (abbrs [i], len);
+
+			if (p)
+				*p = 0;
+		}
+	}
+}
Index: e-util/e-util.h
===================================================================
--- e-util/e-util.h	(revision 34396)
+++ e-util/e-util.h	(working copy)
@@ -107,6 +107,8 @@
 						 gboolean free);
 gchar *		e_file_get_save_path		(void);
 
+void            e_utf8_weekday_abbreviations	(gchar *abbrs[7]);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: widgets/misc/ChangeLog
===================================================================
--- widgets/misc/ChangeLog	(revision 34396)
+++ widgets/misc/ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #392747
+
+	* e-calendar-item.h: (struct _ECalendarItem):
+	Changed type of property 'days', to array of strings.
+	* e-calendar-item.c: (e_calendar_item_init),
+	(e_calendar_item_destroy), (layout_set_day_text):
+	Enumerate week day abbreviations with 'e_utf8_weekday_abbreviations'
+	and fix usage of changed property in proper files.
+
 2007-10-09  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fixes part of bug #437579
Index: widgets/misc/e-calendar-item.c
===================================================================
--- widgets/misc/e-calendar-item.c	(revision 34396)
+++ widgets/misc/e-calendar-item.c	(working copy)
@@ -45,7 +45,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
 #include <libedataserver/e-data-server-util.h>
-#include <e-util/e-util.h>
+#include "e-util/e-util.h"
 
 static const int e_calendar_item_days_in_month[12] = {
 	31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@@ -411,9 +411,7 @@
 	calitem->time_callback_data = NULL;
 	calitem->time_callback_destroy = NULL;
 
-	/* Translators: These are the first characters of each day of the
-	   week, 'M' for 'Monday', 'T' for Tuesday etc. */
-	calitem->days = _("MTWTFSS");
+	e_utf8_weekday_abbreviations (calitem->days);
 
 	calitem->signal_emission_idle_id = 0;
 }
@@ -423,6 +421,7 @@
 e_calendar_item_destroy		(GtkObject *o)
 {
 	ECalendarItem *calitem;
+	int i;
 
 	calitem = E_CALENDAR_ITEM (o);
 
@@ -451,6 +450,12 @@
 
 	if (calitem->selecting_axis)
 		g_free (calitem->selecting_axis);
+
+	for (i = 0; i < 7; i++) {
+		g_free (calitem->days [i]);
+		calitem->days [i] = NULL;
+	}
+
 	if (GTK_OBJECT_CLASS (e_calendar_item_parent_class)->destroy)
 		(* GTK_OBJECT_CLASS (e_calendar_item_parent_class)->destroy) (o);
 }
@@ -964,18 +969,7 @@
 static void
 layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, int day_index)
 {
-	char *day;
-	int char_size = 0;
-
-	day = g_utf8_offset_to_pointer (calitem->days, day_index);
-
-	/* we use strlen because we actually want to count bytes */
-	if (day_index == 6)
-		char_size = strlen (day); 
-	else
-		char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
-
-	pango_layout_set_text (layout, day, char_size);	
+	pango_layout_set_text (layout, calitem->days[day_index], -1);
 }
 
 static void
@@ -1611,18 +1605,7 @@
 static void
 layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, int day_index)
 {
-	char *day;
-	int char_size = 0;
-
-	day = g_utf8_offset_to_pointer (calitem->days, day_index);
-
-	/* we use strlen because we actually want to count bytes */
-	if (day_index == 6)
-		char_size = strlen (day); 
-	else
-		char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
-
-	pango_layout_set_text (layout, day, char_size);	
+	pango_layout_set_text (layout, calitem->days[day_index], -1);
 }
 
 static void
Index: widgets/misc/e-calendar-item.h
===================================================================
--- widgets/misc/e-calendar-item.h	(revision 34396)
+++ widgets/misc/e-calendar-item.h	(working copy)
@@ -216,8 +216,9 @@
 	gint selection_real_start_month_offset;
 	gint selection_real_start_day;
 
-	/* The first character of each day of the week, e.g. 'MTWTFSS'. */
-	gchar *days;
+	/* An array of string pointers to hold abbreviated day names.
+	   First is Monday, then Tuesday, and so on. */
+	gchar *days[7];
 
 	/* Widths of the day characters. */
 	gint day_widths[7];
Index: calendar/gui/weekday-picker.c
===================================================================
--- calendar/gui/weekday-picker.c	(revision 34396)
+++ calendar/gui/weekday-picker.c	(working copy)
@@ -29,6 +29,7 @@
 #include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
 #include <libgnomecanvas/gnome-canvas-text.h>
 #include "weekday-picker.h"
+#include "e-util/e-util.h"
 
 
 
@@ -315,20 +316,21 @@
 static char *
 get_day_text (int day_index)
 {
-	/* The first letter of each day of the week starting with Sunday */
-	const char *str = _("SMTWTFS");
-	char *day;
-	int char_size = 0;
+	gchar *days[7];
+	char *text;
+	int i;
 
-	day = g_utf8_offset_to_pointer (str, day_index);
+	e_utf8_weekday_abbreviations (days);
 
-	/* we use strlen because we actually want to count bytes */
-	if (day_index == 6)
-		char_size = strlen (day); 
-	else
-		char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
+	/* day_index is from subday, but days are from monday */
+	i = (day_index - 1 + 7) % 7;
+	text = days [i];
+	days [i] = NULL;
 
-	return g_strndup (day, char_size);
+	for (i = 0; i < 7; i++)
+		g_free (days [i]);
+
+	return text;
 }
 
 static void
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 34396)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #392747
+
+	* gui/weekday-picker.c: (get_day_text): Use new helper function
+	to obtain abbreviations for week days from glib.
+
 2007-10-12  Michael Monreal <michael.monreal@gmail.com>
 
 	** New view-calendar icons (bug #479257)
Index: a11y/widgets/ea-calendar-item.c
===================================================================
--- a11y/widgets/ea-calendar-item.c	(revision 34396)
+++ a11y/widgets/ea-calendar-item.c	(working copy)
@@ -1119,8 +1119,8 @@
 	AtkGObjectAccessible *atk_gobj;
 	GObject *g_obj;
 	ECalendarItem *calitem;
-	gchar *week_char;
-	gint char_size;
+	gchar *week_abbr;
+	gint byte_size;
 
 	g_return_val_if_fail (ea_calitem, FALSE);
 
@@ -1130,13 +1130,13 @@
 		return FALSE;
 
 	calitem = E_CALENDAR_ITEM (g_obj);
-	week_char = g_utf8_offset_to_pointer (calitem->days, column);
-	char_size = strlen (calitem->days) -
-		strlen (g_utf8_find_next_char (calitem->days, NULL));
+	week_abbr = calitem->days [column];
+	/* we really need byte size, not char size */
+	byte_size = week_abbr ? strlen (week_abbr) : 0;
 
-	if (week_char && char_size < buffer_size) {
-		memcpy (buffer, week_char, char_size);
-		buffer[char_size] = '\0';
+	if (week_abbr && byte_size < buffer_size) {
+		memcpy (buffer, week_abbr, byte_size);
+		buffer[byte_size] = '\0';
 		return TRUE;
 	}
 	return FALSE;
Index: a11y/ChangeLog
===================================================================
--- a11y/ChangeLog	(revision 34396)
+++ a11y/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-10-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #392747
+
+	* widgets/ea-calendar-item.c: (ea_calendar_item_get_column_label):
+	Type of calitem->days has been changed, so propagate change here too.
+
 2007-09-10  Srinivasa Ragavan  <sragavan@novell.com>
 
 	** Fix for bug #471791 
