aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorDanilo Šegan <danilo@src.gnome.org>2004-03-24 08:18:02 +0800
committerDanilo Šegan <danilo@src.gnome.org>2004-03-24 08:18:02 +0800
commit7c70ddcc35a65e1078a7789832e5209a7a2e4a5b (patch)
tree75dd3c44ad9d0eeb512969116852bb765fba1bd5 /calendar/gui
parent6f309e984bbfd7b5376dd38637a55dd46d307c92 (diff)
downloadgsoc2013-evolution-7c70ddcc35a65e1078a7789832e5209a7a2e4a5b.tar.gz
gsoc2013-evolution-7c70ddcc35a65e1078a7789832e5209a7a2e4a5b.tar.zst
gsoc2013-evolution-7c70ddcc35a65e1078a7789832e5209a7a2e4a5b.zip
Use ngettext for handling plural forms throughout (fixes bug 53464).
svn path=/trunk/; revision=25168
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/delete-comp.c18
-rw-r--r--calendar/gui/e-alarm-list.c35
-rw-r--r--calendar/gui/e-itip-control.c35
3 files changed, 31 insertions, 57 deletions
diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c
index 843f79ad3c..1c81598021 100644
--- a/calendar/gui/dialogs/delete-comp.c
+++ b/calendar/gui/dialogs/delete-comp.c
@@ -128,18 +128,24 @@ delete_component_dialog (ECalComponent *comp,
} else {
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d appointments?"), n_comps);
+ str = g_strdup_printf (ngettext("Are you sure you want to delete "
+ "%d appointment?",
+ "Are you sure you want to delete "
+ "%d appointments?", n_comps), n_comps);
break;
case E_CAL_COMPONENT_TODO:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d tasks?"), n_comps);
+ str = g_strdup_printf (ngettext("Are you sure you want to delete "
+ "%d task?",
+ "Are you sure you want to delete "
+ "%d tasks?", n_comps), n_comps);
break;
case E_CAL_COMPONENT_JOURNAL:
- str = g_strdup_printf (_("Are you sure you want to delete "
- "%d journal entries?"), n_comps);
+ str = g_strdup_printf (ngettext("Are you sure you want to delete "
+ "%d journal entry?",
+ "Are you sure you want to delete "
+ "%d journal entries?", n_comps), n_comps);
break;
default:
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
index c8b968600f..705e6bac54 100644
--- a/calendar/gui/e-alarm-list.c
+++ b/calendar/gui/e-alarm-list.c
@@ -391,43 +391,28 @@ get_alarm_duration_string (struct icaldurationtype *duration)
have_something = FALSE;
- if (duration->days > 1) {
- g_string_sprintf (string, _("%d days"), duration->days);
- have_something = TRUE;
- } else if (duration->days == 1) {
- g_string_append (string, _("1 day"));
+ if (duration->days >= 1) {
+ g_string_sprintf (string, ngettext("%d day", "%d days", duration->days), duration->days);
have_something = TRUE;
}
- if (duration->weeks > 1) {
- g_string_sprintf (string, _("%d weeks"), duration->weeks);
- have_something = TRUE;
- } else if (duration->weeks == 1) {
- g_string_append (string, _("1 week"));
+ if (duration->weeks >= 1) {
+ g_string_sprintf (string, ngettext("%d week","%d weeks", duration->weeks), duration->weeks);
have_something = TRUE;
}
- if (duration->hours > 1) {
- g_string_sprintf (string, _("%d hours"), duration->hours);
- have_something = TRUE;
- } else if (duration->hours == 1) {
- g_string_append (string, _("1 hour"));
+ if (duration->hours >= 1) {
+ g_string_sprintf (string, ngettext("%d hour", "%d hours", duration->hours), duration->hours);
have_something = TRUE;
}
- if (duration->minutes > 1) {
- g_string_sprintf (string, _("%d minutes"), duration->minutes);
- have_something = TRUE;
- } else if (duration->minutes == 1) {
- g_string_append (string, _("1 minute"));
+ if (duration->minutes >= 1) {
+ g_string_sprintf (string, ngettext("%d minute", "%d minutes", duration->minutes), duration->minutes);
have_something = TRUE;
}
- if (duration->seconds > 1) {
- g_string_sprintf (string, _("%d seconds"), duration->seconds);
- have_something = TRUE;
- } else if (duration->seconds == 1) {
- g_string_append (string, _("1 second"));
+ if (duration->seconds >= 1) {
+ g_string_sprintf (string, ngettext("%d second", "%d seconds", duration->seconds), duration->seconds);
have_something = TRUE;
}
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index bff068a5b8..30a357a158 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -599,23 +599,14 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp,
switch (r->freq) {
case ICAL_DAILY_RECURRENCE:
- if (r->interval == 1)
- strcpy (buffer, _("Every day"));
- else
- sprintf (buffer, _("Every %d days"), r->interval);
+ sprintf (buffer, ngettext("Every day", "Every %d days", r->interval), r->interval);
break;
case ICAL_WEEKLY_RECURRENCE:
if (r->by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) {
- if (r->interval == 1)
- strcpy (buffer, _("Every week"));
- else
- sprintf (buffer, _("Every %d weeks"), r->interval);
+ sprintf (buffer, ngettext("Every week", "Every %d weeks", r->interval), r->interval);
} else {
- if (r->interval == 1)
- strcpy (buffer, _("Every week on "));
- else
- sprintf (buffer, _("Every %d weeks on "), r->interval);
+ sprintf (buffer, ngettext("Every week on ", "Every %d weeks on ", r->interval), r->interval);
for (i = 1; i < 8 && r->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) {
if (i > 1)
@@ -647,22 +638,14 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp,
nth (pos), get_dayname (r, 0));
}
- if (r->interval == 1)
- strcat (buffer, _("every month"));
- else {
- len = strlen (buffer);
- buffer += len;
- size -= len;
- sprintf (buffer, _("every %d months"), r->interval);
- }
+ len = strlen (buffer);
+ buffer += len;
+ size -= len;
+ sprintf (buffer, ngettext("every month","every %d months", r->interval), r->interval);
break;
case ICAL_YEARLY_RECURRENCE:
- if (r->interval == 1)
- strcpy (buffer, _("Every year"));
- else {
- sprintf (buffer, _("Every %d years"), r->interval);
- }
+ sprintf (buffer, ngettext("Every year", "Every %d years", r->interval), r->interval);
break;
default:
@@ -673,7 +656,7 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp,
buffer += len;
size -= len;
if (r->count) {
- sprintf (buffer, _(" a total of %d times"), r->count);
+ sprintf (buffer, ngettext("a total of %d time", " a total of %d times", r->count), r->count);
} else if (!icaltime_is_null_time (r->until)) {
ECalComponentDateTime dt;