fantasdic r330 - in trunk: . lib/fantasdic lib/fantasdic/ui



Author: mblondel
Date: Sat Aug 23 06:12:38 2008
New Revision: 330
URL: http://svn.gnome.org/viewvc/fantasdic?rev=330&view=rev

Log:
    * lib/fantasdic/ui/main_app.rb: Fixed bug with plural form.
    * lib/fantasdic/command_line.rb: Ditto.


Modified:
   trunk/ChangeLog
   trunk/lib/fantasdic/command_line.rb
   trunk/lib/fantasdic/ui/main_app.rb

Modified: trunk/lib/fantasdic/command_line.rb
==============================================================================
--- trunk/lib/fantasdic/command_line.rb	(original)
+++ trunk/lib/fantasdic/command_line.rb	Sat Aug 23 06:12:38 2008
@@ -101,8 +101,10 @@
     if definitions.empty?
         puts _("No match found.")
     else
-        puts ngettext("One match found.", "Matches found: %d.",
-                      definitions.length) % definitions.length
+        msg = ngettext("One match found.", "Matches found: %d.",
+                      definitions.length)
+        msg = msg % definitions.length if definitions.length > 1
+        puts msg
     end
 
     last_db = ""

Modified: trunk/lib/fantasdic/ui/main_app.rb
==============================================================================
--- trunk/lib/fantasdic/ui/main_app.rb	(original)
+++ trunk/lib/fantasdic/ui/main_app.rb	Sat Aug 23 06:12:38 2008
@@ -249,10 +249,12 @@
                 msg = _("No definition found.")
                 self.status_bar_msg = msg
                 @buf.insert_header(msg)
-            else
-                self.status_bar_msg = \
-                    ngettext("One definition found.", "Definitions found: %d.",
-                             definitions.length) % definitions.length
+            else 
+                msg = ngettext("One definition found.",
+                               "Definitions found: %d.",
+                               definitions.length)
+                msg = msg % definitions.length if definitions.length > 1
+                self.status_bar_msg = msg
             end
         end
 
@@ -284,8 +286,10 @@
 
                 self.status_bar_msg = ""
 
-                @matches_label.text = \
-                    ngettext("1 match", "%d matches", nb_match) % nb_match
+                msg = \
+                    ngettext("1 match", "%d matches", nb_match)
+                msg = msg % nb_match if nb_match > 1
+                @matches_label.text = msg
             else
                 msg = _("No match found.")
                 @matches_label.text = _("Matches")



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