[gnome-contacts] Using ngettext for plural translations.



commit da878cd7f0f55d326b3160173696bf4dd9b5c3e8
Author: Erick PÃrez Castellanos <erick red gmail com>
Date:   Mon Feb 18 13:30:22 2013 -0500

    Using ngettext for plural translations.
    
    As you can see the use of ngettext is only needed in the case
    of delete operation, when linking is always
    plural since you need at least two contacts for a link operation.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=694032

 src/contacts-app.vala |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 0551c75..ce0f506 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -495,11 +495,7 @@ public class Contacts.App : Gtk.Application {
     g.set_column_spacing (8);
     notification.add (g);
 
-    string msg;
-    if (contact_list.size > 2)
-      msg = _("%d contacts linked").printf (contact_list.size);
-    else
-      msg = _("Contacts linked");
+    string msg = _("%d contacts linked").printf (contact_list.size);
 
     var b = new Button.from_stock (Stock.UNDO);
     g.add (new Label (msg));
@@ -528,11 +524,10 @@ public class Contacts.App : Gtk.Application {
     g.set_column_spacing (8);
     notification.add (g);
 
-    string msg;
-    if (contact_list.size > 1)
-      msg = _("%d contacts deleted").printf (contact_list.size);
-    else
-      msg = _("Contact deleted");
+    string msg = ngettext ("%d contact deleted",
+                           "%d contacts deleted",
+                           contact_list.size).printf (contact_list.size);
+
     var b = new Button.from_stock (Stock.UNDO);
     g.add (new Label (msg));
     g.add (b);


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