[PATCH] Use ngettext where appropriate



For strings with singular/plural forms, it's better for translators
to use ngettext.
---
 src/app.vala    |    2 +-
 src/topbar.vala |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app.vala b/src/app.vala
index 7724915..f7ad9bb 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -429,7 +429,7 @@ private class Boxes.App: Boxes.UI {
             return;
 
         var message = (num_selected == 1) ? _("Box '%s' has been deleted").printf (selected_items.data.name) :
-                                            _("%u boxes have been deleted").printf (num_selected);
+                                            ngettext ("%u box has been deleted", "%u boxes have been deleted", num_selected).printf (num_selected);
         foreach (var item in selected_items)
             view.remove_item (item);
 
diff --git a/src/topbar.vala b/src/topbar.vala
index 57dc934..c61c0cf 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -152,7 +152,7 @@ private class Boxes.Topbar: Boxes.UI {
     private void update_selection_label () {
         var items = app.selected_items.length ();
         if (items > 0)
-            selection_label.set_markup ("<b>" + _("%d selected").printf (items) + "</b>");
+            selection_label.set_markup ("<b>" + ngettext ("%d selected", "%d selected", items).printf (items) + "</b>");
         else
             selection_label.set_markup ("<i>" + _("Click on items to select them") + "</i>");
     }
-- 
1.7.7.5



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