From 53cf58b7cf4b930ada93fd871b3107bb265ac696 Mon Sep 17 00:00:00 2001 From: Harry Lu Date: Wed, 2 Feb 2005 02:10:09 +0000 Subject: Fix for 71924, 71926, 71932 Don't split sentences that need translation. 2005-02-01 Harry Lu Fix for 71924, 71926, 71932 Don't split sentences that need translation. Also remove two useless variables. * calendar/ea-cal-view-event.c: (ea_cal_view_event_get_name): * calendar/ea-day-view.c: (ea_day_view_get_name): * calendar/ea-week-view.c: (ea_week_view_get_name), (ea_week_view_get_n_children): * widgets/ea-calendar-item.c: (ea_calendar_item_get_name), (e_calendar_item_get_offset_for_date): svn path=/trunk/; revision=28668 --- a11y/widgets/ea-calendar-item.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'a11y/widgets') diff --git a/a11y/widgets/ea-calendar-item.c b/a11y/widgets/ea-calendar-item.c index ac5eb1ff41..b80bbdcb77 100644 --- a/a11y/widgets/ea-calendar-item.c +++ b/a11y/widgets/ea-calendar-item.c @@ -267,17 +267,14 @@ ea_calendar_item_get_name (AtkObject *accessible) ECalendarItem *calitem; gint start_year, start_month, start_day; gint end_year, end_month, end_day; - static gchar new_name[256] = ""; - gchar buffer_start[128] = ""; - gchar buffer_end[128] = ""; - struct tm day_start = { 0 }; - struct tm day_end = { 0 }; + gchar *name_str = NULL; + gchar buffer_start[128] = ""; + gchar buffer_end[128] = ""; + struct tm day_start = { 0 }; + struct tm day_end = { 0 }; g_return_val_if_fail (EA_IS_CALENDAR_ITEM (accessible), NULL); - if (accessible->name) - return accessible->name; - g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(accessible)); g_return_val_if_fail (E_IS_CALENDAR_ITEM (g_obj), NULL); @@ -290,19 +287,15 @@ ea_calendar_item_get_name (AtkObject *accessible) day_start.tm_mon = start_month; day_start.tm_mday = start_day; day_start.tm_isdst = -1; - e_utf8_strftime (buffer_start, sizeof (buffer_start), _(" %d %B %Y"), &day_start); + e_utf8_strftime (buffer_start, sizeof (buffer_start), _("%d %B %Y"), &day_start); day_end.tm_year = end_year - 1900; day_end.tm_mon = end_month; day_end.tm_mday = end_day; day_end.tm_isdst = -1; - e_utf8_strftime (buffer_end, sizeof (buffer_end), _(" %d %B %Y"), &day_end); + e_utf8_strftime (buffer_end, sizeof (buffer_end), _("%d %B %Y"), &day_end); - strcat (new_name, _("calendar (from ")); - strcat (new_name, buffer_start); - strcat (new_name, _(" to ")); - strcat (new_name, buffer_end); - strcat (new_name, _(")")); + name_str = g_strdup_printf (_("Calendar: from %s to %s"), buffer_start, buffer_end); } #if 0 @@ -325,7 +318,10 @@ ea_calendar_item_get_name (AtkObject *accessible) } #endif - return new_name; + ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_str); + g_free (name_str); + + return accessible->name; } static G_CONST_RETURN gchar* @@ -1264,7 +1260,6 @@ e_calendar_item_get_offset_for_date (ECalendarItem *calitem, gint start_year, start_month, start_day; gint end_year, end_month, end_day; GDate *start_date, *end_date; - gint n_days; *offset = 0; g_return_val_if_fail (E_IS_CALENDAR_ITEM (calitem), FALSE); -- cgit