Index: gtk/gtkcalendar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcalendar.c,v
retrieving revision 1.46
diff -u -b -B -p -r1.46 gtkcalendar.c
--- gtk/gtkcalendar.c	15 Dec 2002 01:47:23 -0000	1.46
+++ gtk/gtkcalendar.c	7 May 2003 22:45:15 -0000
@@ -41,6 +41,7 @@
 
 #include "gtkcalendar.h"
 #include "gtkmarshalers.h"
+#include "gtkintl.h"
 #include "gdk/gdkkeysyms.h"
 
 /***************************************************************************/
@@ -252,6 +253,8 @@ struct _GtkCalendarPrivateData
   guint dirty_day_names : 1;
   guint dirty_main : 1;
   guint dirty_week : 1;
+
+  guint year_left : 1;
 };
 
 #define GTK_CALENDAR_PRIVATE_DATA(widget)  (((GtkCalendarPrivateData*)(GTK_CALENDAR (widget)->private_data)))
@@ -500,6 +503,22 @@ gtk_calendar_init (GtkCalendar *calendar
   private_data->dirty_day_names = 0;
   private_data->dirty_week = 0;
   private_data->dirty_main = 0;
+
+  private_data->year_left = 0;
+
+  {
+  /* Translate to calendar:YM if you want years to be displayed
+   * on the left side; otherwise translate to calendar:MY.
+   * Do *not* translate it to anything else, if it
+   * it isn't calendar:YM or calendar:MY it will not work.
+   */
+    char *e = _("calendar:MY");
+    if (strcmp (e, "calendar:YM") == 0) {
+      private_data->year_left = 1;
+    } else if (strcmp (e, "calendar:MY")) {
+      g_warning ("Whoever translated calendar:MY did so wrongly.\n");
+    }
+  }
 }
 
 GtkWidget*
@@ -881,18 +858,34 @@ gtk_calendar_realize_arrows (GtkWidget *
 	  switch (i)
 	    {
 	    case ARROW_MONTH_LEFT:
+	      if (private_data->year_left) 
+		attributes.x = (widget->allocation.width - 2 * widget->style->xthickness
+				- (3 + 2*private_data->arrow_width 
+				   + private_data->max_month_width));
+	      else
 	      attributes.x = 3;
 	      break;
 	    case ARROW_MONTH_RIGHT:
+	      if (private_data->year_left) 
+		attributes.x = (widget->allocation.width - 2 * widget->style->xthickness 
+				- 3 - private_data->arrow_width);
+	      else
 	      attributes.x = (private_data->arrow_width 
 			      + private_data->max_month_width);
 	      break;
 	    case ARROW_YEAR_LEFT:
+	      if (private_data->year_left) 
+		attributes.x = 3;
+	      else
 	      attributes.x = (widget->allocation.width - 2 * widget->style->xthickness
 			      - (3 + 2*private_data->arrow_width 
 				 + private_data->max_year_width));
 	      break;
 	    case ARROW_YEAR_RIGHT:
+	      if (private_data->year_left) 
+		attributes.x = (private_data->arrow_width 
+				+ private_data->max_year_width);
+	      else
 	      attributes.x = (widget->allocation.width - 2 * widget->style->xthickness 
 			      - 3 - private_data->arrow_width);
 	      break;
@@ -1371,18 +1364,46 @@ gtk_calendar_size_allocate (GtkWidget	  
 				xthickness, ythickness,
 				allocation->width - 2 * xthickness, private_data->header_h);
       if (private_data->arrow_win[ARROW_MONTH_LEFT])
+	{
+	  if (private_data->year_left)
+	    gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT],
+				    (allocation->width - 2 * xthickness
+				     - (3 + 2*private_data->arrow_width 
+					+ private_data->max_month_width)),
+				    3,
+				    private_data->arrow_width,
+				    private_data->header_h - 7);
+	  else
 	gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_LEFT],
 				3, 3,
 				private_data->arrow_width,
 				private_data->header_h - 7);
+	}
       if (private_data->arrow_win[ARROW_MONTH_RIGHT])
+	{
+	  if (private_data->year_left)
+	    gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT],
+				    (allocation->width - 2 * xthickness 
+				     - 3 - private_data->arrow_width), 
+				    3,
+				    private_data->arrow_width,
+				    private_data->header_h - 7);
+	  else
 	gdk_window_move_resize (private_data->arrow_win[ARROW_MONTH_RIGHT],
 				(private_data->arrow_width 
 				 + private_data->max_month_width), 
 				3,
 				private_data->arrow_width,
 				private_data->header_h - 7);
+	}
       if (private_data->arrow_win[ARROW_YEAR_LEFT])
+	{
+	  if (private_data->year_left)
+	    gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_LEFT],
+				    3, 3,
+				    private_data->arrow_width,
+				    private_data->header_h - 7);
+	  else
 	gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_LEFT],
 				(allocation->width - 2 * xthickness
 				 - (3 + 2*private_data->arrow_width 
@@ -1390,13 +1411,24 @@ gtk_calendar_size_allocate (GtkWidget	  
 				3,
 				private_data->arrow_width,
 				private_data->header_h - 7);
+	}
       if (private_data->arrow_win[ARROW_YEAR_RIGHT])
+	{
+	  if (private_data->year_left)
+	    gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_RIGHT],
+				    (private_data->arrow_width 
+				     + private_data->max_year_width), 
+				    3,
+				    private_data->arrow_width,
+				    private_data->header_h - 7);
+	  else
 	gdk_window_move_resize (private_data->arrow_win[ARROW_YEAR_RIGHT],
 				(allocation->width - 2 * xthickness 
 				 - 3 - private_data->arrow_width), 
 				3,
 				private_data->arrow_width,
 				private_data->header_h - 7);
+	}
       if (private_data->day_name_win)
 	gdk_window_move_resize (private_data->day_name_win,
 				xthickness + INNER_BORDER,
@@ -1506,9 +1538,15 @@ gtk_calendar_paint_header (GtkWidget *wi
   /* Draw year and its arrows */
   
   if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
+    if (private_data->year_left)
+      x = 3 + (max_year_width - logical_rect.width)/2;
+    else
     x = header_width - (3 + max_year_width
 			- (max_year_width - logical_rect.width)/2);
   else
+    if (private_data->year_left)
+      x = 3 + private_data->arrow_width + (max_year_width - logical_rect.width)/2;
+    else
     x = header_width - (3 + private_data->arrow_width + max_year_width
 			- (max_year_width - logical_rect.width)/2);
     
@@ -1522,8 +1560,16 @@ gtk_calendar_paint_header (GtkWidget *wi
   pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
 
   if (calendar->display_flags & GTK_CALENDAR_NO_MONTH_CHANGE)
+    if (private_data->year_left)
+      x = header_width - (3 + max_month_width
+			  - (max_month_width - logical_rect.width)/2);      
+    else
     x = 3 + (max_month_width - logical_rect.width) / 2;
   else
+    if (private_data->year_left)
+      x = header_width - (3 + private_data->arrow_width + max_month_width
+			  - (max_month_width - logical_rect.width)/2);
+    else
     x = 3 + private_data->arrow_width + (max_month_width - logical_rect.width)/2;
 
   gdk_draw_layout (private_data->header_win, gc, x, y, layout);
 
