[evolution/wip/webkit2] Bug 761993 - Use ngettext() for "composer-many-to-cc-recips-num" option question



commit 342d1a3151090364877d3855fccaec7d78ecff14
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 18 22:28:54 2016 +0100

    Bug 761993 - Use ngettext() for "composer-many-to-cc-recips-num" option question

 mail/em-composer-utils.c |   33 +++++++++++++++++++++++++++------
 mail/mail.error.xml      |    4 ++--
 2 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 3a46355..056ab87 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -379,22 +379,42 @@ composer_presend_check_recipients (EMsgComposer *composer,
        }
 
        settings = e_util_ref_settings ("org.gnome.evolution.mail");
-       if (num_to_cc >= g_settings_get_int (settings, "composer-many-to-cc-recips-num")) {
-               gchar *num_str;
+       if (num_to_cc > 1 && num_to_cc >= g_settings_get_int (settings, "composer-many-to-cc-recips-num")) {
+               gchar *head;
+               gchar *msg;
 
                g_clear_object (&settings);
 
-               num_str = g_strdup_printf ("%d", num_to_cc);
+               head = g_strdup_printf (ngettext (
+                       /* Translators: The %d is replaced with the actual count of recipients, which is 
always more than one. */
+                       "Are you sure you want to send a message with %d To and CC recipients?",
+                       "Are you sure you want to send a message with %d To and CC recipients?",
+                       num_to_cc), num_to_cc);
+
+               msg = g_strdup_printf (ngettext (
+                       /* Translators: The %d is replaced with the actual count of recipients, which is 
always more than one. */
+                       "You are trying to send a message to %d recipients in To and CC fields."
+                       " This would result in all recipients seeing the email addresses of each"
+                       " other. In some cases this behaviour is undesired, especially if they"
+                       " do not know each other or if privacy is a concern. Consider adding"
+                       " recipients to the BCC field instead.",
+                       "You are trying to send a message to %d recipients in To and CC fields."
+                       " This would result in all recipients seeing the email addresses of each"
+                       " other. In some cases this behaviour is undesired, especially if they"
+                       " do not know each other or if privacy is a concern. Consider adding"
+                       " recipients to the BCC field instead.",
+                       num_to_cc), num_to_cc);
 
                if (!e_util_prompt_user (
                        GTK_WINDOW (composer),
                        "org.gnome.evolution.mail",
                        "prompt-on-many-to-cc-recips",
                        "mail:ask-many-to-cc-recips",
-                       num_str, NULL)) {
+                       head, msg, NULL)) {
                        GtkAction *action;
 
-                       g_free (num_str);
+                       g_free (head);
+                       g_free (msg);
 
                        action = E_COMPOSER_ACTION_VIEW_BCC (composer);
                        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
@@ -402,7 +422,8 @@ composer_presend_check_recipients (EMsgComposer *composer,
                        goto finished;
                }
 
-               g_free (num_str);
+               g_free (head);
+               g_free (msg);
        }
        g_clear_object (&settings);
 
diff --git a/mail/mail.error.xml b/mail/mail.error.xml
index 85b2e7a..6853c9e 100644
--- a/mail/mail.error.xml
+++ b/mail/mail.error.xml
@@ -43,8 +43,8 @@ Many email systems add an Apparently-To header to messages that only have BCC re
   </error>
 
   <error id="ask-many-to-cc-recips" type="warning" default="GTK_RESPONSE_YES">
-    <_primary>Are you sure you want to send a message with {0} To and CC recipients?</_primary>
-    <_secondary>You are trying to send a message to {0} recipients in To and CC fields. This would result in 
all recipients seeing the email addresses of each other. In some cases this behaviour is undesired, 
especially if they do not know each other or if privacy is a concern. Consider adding recipients to the BCC 
field instead.</_secondary>
+    <primary>{0}</primary>
+    <secondary>{1}</secondary>
     <button response="GTK_RESPONSE_CANCEL" _label="_Cancel"/>
     <button response="GTK_RESPONSE_YES" _label="_Send"></button>
   </error>


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