--- widgets/misc/e-calendar-item.c.calendar-item-locale-digits	2004-12-15 02:44:29.000000000 +0330
+++ widgets/misc/e-calendar-item.c	2006-04-24 05:02:56.000000000 +0330
@@ -1246,7 +1246,7 @@
 	gboolean today, selected, has_focus, drop_target = FALSE;
 	gboolean bold, draw_day, finished = FALSE;
 	gint today_year, today_month, today_mday, month_offset;
-	gchar buffer[2];
+	gchar buffer[9];
 	gint day_style = 0;
 	PangoContext *pango_context;
 	PangoFontMetrics *font_metrics;
@@ -1353,12 +1353,12 @@
 			if (week_num >= 10) {
 				digit = week_num / 10;
 				text_x -= calitem->week_number_digit_widths[digit];
-				buffer[num_chars++] = digit + '0';
+				num_chars += sprintf (&buffer[num_chars], "%Id", digit);
 			}
 
 			digit = week_num % 10;
 			text_x -= calitem->week_number_digit_widths[digit];
-			buffer[num_chars++] = digit + '0';
+			num_chars += sprintf (&buffer[num_chars], "%Id", digit);
 
 			gdk_gc_set_foreground (fg_gc,
 					       &style->fg[GTK_STATE_NORMAL]);
@@ -1462,12 +1462,12 @@
 				if (day_num >= 10) {
 					digit = day_num / 10;
 					day_x -= calitem->digit_widths[digit];
-					buffer[num_chars++] = digit + '0';
+					num_chars += sprintf (&buffer[num_chars], "%Id", digit);
 				}
 
 				digit = day_num % 10;
 				day_x -= calitem->digit_widths[digit];
-				buffer[num_chars++] = digit + '0';
+				num_chars += sprintf (&buffer[num_chars], "%Id", digit);
 
 				if (fg_color) {
 					gdk_gc_set_foreground (fg_gc,
@@ -1757,7 +1757,6 @@
 {
 	GnomeCanvasItem *canvas_item;
 	GtkStyle *style;
-	gchar *digits = "0123456789";
 	gint day, digit, max_digit_width, max_week_number_digit_width;
 	gint char_height, width, min_cell_width, min_cell_height;
 	PangoFontDescription *font_desc, *wkfont_desc;
@@ -1795,7 +1794,12 @@
 	max_digit_width = 0;
 	max_week_number_digit_width = 0;
 	for (digit = 0; digit < 10; digit++) {
-		pango_layout_set_text (layout, &digits [digit], 1);
+		gchar locale_digit[5];
+		int locale_digit_len;
+		
+		locale_digit_len = sprintf (locale_digit, "%Id", digit);
+
+		pango_layout_set_text (layout, locale_digit, locale_digit_len);
 		pango_layout_get_pixel_size (layout, &width, NULL);
 
 		calitem->digit_widths[digit] = width;
@@ -1805,7 +1809,7 @@
 			pango_context_set_font_description (pango_context, wkfont_desc);
 			pango_layout_context_changed (layout);
 
-			pango_layout_set_text (layout, &digits [digit], 1);
+			pango_layout_set_text (layout, locale_digit, locale_digit_len);
 			pango_layout_get_pixel_size (layout, &width, NULL);
 
 			calitem->week_number_digit_widths[digit] = width;
@@ -3184,7 +3188,9 @@
 
 	gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition);
 
-	*x -= 2;
+	*x -= (gtk_widget_get_direction(GTK_WIDGET(menu)) == GTK_TEXT_DIR_RTL)
+		? requisition.width - 2
+		: 2;
 	*y -= requisition.height / 2;
 
 	screen_width = gdk_screen_width ();
