[geary] Use ngettext() for plural forms: Closes bgno#722055



commit f642be549d4478159fc200af221e3aed4d1c9601
Author: Jim Nelson <jim yorba org>
Date:   Mon Jan 13 11:20:21 2014 -0800

    Use ngettext() for plural forms: Closes bgno#722055

 src/client/components/conversation-find-bar.vala   |    4 ++--
 .../conversation-viewer/conversation-viewer.vala   |   11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/client/components/conversation-find-bar.vala 
b/src/client/components/conversation-find-bar.vala
index e870758..8add0c1 100644
--- a/src/client/components/conversation-find-bar.vala
+++ b/src/client/components/conversation-find-bar.vala
@@ -211,9 +211,9 @@ public class ConversationFindBar : Gtk.Layout {
         
         if (matches > 0) {
             if (!wrapped)
-                content += _("%i matches").printf(matches);
+                content += ngettext("%i match", "%i matches", matches).printf(matches);
             else
-                content += _("%i matches (wrapped)").printf(matches);
+                content += ngettext("%i match (wrapped)", "%i matches (wrapped)", matches).printf(matches);
         } else {
             content += _("not found");
         }
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index 145acf4..c1ea5f9 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -250,10 +250,12 @@ public class ConversationViewer : Gtk.Box {
     }
     
     private void show_multiple_selected(uint selected_count) {
-        if (selected_count == 0)
+        if (selected_count == 0) {
             show_special_message(_("No conversations selected."));
-        else
-            show_special_message(_("%u conversations selected.").printf(selected_count));
+        } else {
+            show_special_message(ngettext("%u conversation selected.", "%u conversations selected.",
+                selected_count).printf(selected_count));
+        }
     }
     
     private void on_folder_selected(Geary.Folder? folder) {
@@ -839,7 +841,8 @@ public class ConversationViewer : Gtk.Box {
                         WebKit.DOM.HTMLElement span =
                             first_compressed.first_element_child.first_element_child
                             as WebKit.DOM.HTMLElement;
-                        span.set_inner_html(_("%u read messages").printf(compress_count));
+                        span.set_inner_html(
+                            ngettext("%u read message", "%u read messages", 
compress_count).printf(compress_count));
                         // We need to set the display to get an accurate offset_height
                         span.set_attribute("style", "display:inline-block;");
                         span.set_attribute("style", "display:inline-block; top:%ipx".printf(


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