[evolution-patches] patch uses ngettext




Hi,

As you tell us to use ngettext, I have a patch here.
Please review.

Thanks,
Li
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/a11y/ChangeLog,v
retrieving revision 1.21
diff -u -r1.21 ChangeLog
--- ChangeLog	29 Oct 2004 09:56:35 -0000	1.21
+++ ChangeLog	1 Nov 2004 10:37:22 -0000
@@ -1,3 +1,10 @@
+2004-11-01  Li Yuan  <li yuan sun com>
+
+	* calendar/ea-day-view.c: (ea_day_view_get_name):
+	use ngettext for n_events.
+	* calendar/ea-week-view.c: (ea_week_view_get_name):
+	ditto.
+
 2004-10-26  Li Yuan  <li yuan sun com>
 
 	* calendar/ea-day-view.c: (ea_day_view_get_name):
Index: calendar/ea-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-day-view.c,v
retrieving revision 1.6
diff -u -r1.6 ea-day-view.c
--- calendar/ea-day-view.c	29 Oct 2004 09:56:35 -0000	1.6
+++ calendar/ea-day-view.c	1 Nov 2004 10:37:29 -0000
@@ -143,12 +143,8 @@
 	n_events = atk_object_get_n_accessible_children (accessible);
 	/* the child main item is always there */
 	--n_events;
-	if (n_events == 1)
-		g_snprintf (buffer, sizeof (buffer),
-			    _(", %d event"), n_events);
-        if (n_events > 1)
-                g_snprintf (buffer, sizeof (buffer),
-                            _(", %d events"), n_events);
+	if (n_events >= 1)
+		g_snprintf (buffer, sizeof (buffer), ngettext ( _(", %d event"), _(", %d events"), n_events), n_events);
 	view_type = gnome_calendar_get_view (gcal);
 	if (view_type == GNOME_CAL_WORK_WEEK_VIEW)
 		accessible->name = g_strconcat (_("work week view :"),
Index: calendar/ea-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-week-view.c,v
retrieving revision 1.9
diff -u -r1.9 ea-week-view.c
--- calendar/ea-week-view.c	29 Oct 2004 09:56:35 -0000	1.9
+++ calendar/ea-week-view.c	1 Nov 2004 10:37:40 -0000
@@ -144,12 +144,8 @@
 	n_events = atk_object_get_n_accessible_children (accessible);
 	/* the child main item is always there */
 	--n_events;
-	if (n_events == 1)
-		g_snprintf (buffer, sizeof (buffer),
-			    _(", %d event"), n_events);
-        if (n_events > 1)
-                g_snprintf (buffer, sizeof (buffer),
-                            _(", %d events"), n_events);
+	if (n_events >= 1)
+		g_snprintf (buffer, sizeof (buffer), ngettext ( _(", %d event"), _(", %d events"), n_events), n_events);
 
 	view_type = gnome_calendar_get_view (gcal);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]