[evolution] Localize few strings with ngettext



commit 081ee1af21e55ceda819a8a075c1bc25a3417f52
Author: Milan Crha <mcrha redhat com>
Date:   Thu Dec 2 16:24:42 2010 +0100

    Localize few strings with ngettext
    
    Per request of bug #635414

 addressbook/gui/widgets/e-addressbook-view.c |   10 +++++++---
 e-util/e-datetime-format.c                   |    6 ++++--
 mail/e-mail-reader.c                         |    4 ++--
 3 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index bb5fc15..ecb6ea7 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1469,9 +1469,13 @@ e_addressbook_view_view (EAddressbookView *view)
 		/* XXX Provide a parent window. */
 		dialog = gtk_message_dialog_new (
 			NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
-			_("Opening %d contacts will open %d new windows as "
-			  "well.\nDo you really want to display all of these "
-			  "contacts?"), length, length);
+			ngettext (
+				/* Translators: This is shown for more than 5 contacts. */
+				"Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?",
+				"Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?",
+				length
+				),
+			length, length);
 		gtk_dialog_add_buttons (
 			GTK_DIALOG (dialog),
 			_("_Don't Display"), GTK_RESPONSE_NO,
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index f5155be..39f0e36 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -212,8 +212,10 @@ format_relative_date (time_t tvalue, time_t ttoday, const struct tm *value, cons
 				res = g_strdup (_("Yesterday"));
 		} else {
 			if (future) {
-				/* Translators: %a is a strftime modifier, the abbreviated week day name, for example "Next Tue" */
-				res = g_strdup (_("Next %a"));
+				/* Translators: %a is a strftime modifier, the abbreviated week day name, for example "Next Tue".
+				   ngettext is used to be able to define different translations for different days of week, where
+				   necessary. Index is between 1 and 7 inclusive, meaning 1 .. Monday, 2 .. Tuesday, ..., 7 .. Sunday */
+				res = g_strdup (ngettext ("Next %a", "Next %a", g_date_get_weekday (&val)));
 			} else {
 				res = g_strdup ("%a");
 			}
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 59cc406..3d3c4b3 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -507,8 +507,8 @@ remove_duplicates_got_messages_cb (CamelFolder *folder, GPtrArray *uids, GPtrArr
 		gchar *msg = g_strdup_printf (ngettext (
 			/* Translators: %s is replaced with a folder name
 			   %d with count of duplicate messages. */
-			_("Folder '%s' contains %d duplicate message. Are you sure you want to delete it?"),
-			_("Folder '%s' contains %d duplicate messages. Are you sure you want to delete them?"),
+			"Folder '%s' contains %d duplicate message. Are you sure you want to delete it?",
+			"Folder '%s' contains %d duplicate messages. Are you sure you want to delete them?",
 			dups->len),
 			camel_folder_get_name (folder), dups->len);
 



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