[gnome-clocks] Use .format with ngettext



commit 23ee5113338b65f4901350f66e58ae434e99147e
Author: Khaled Hosny <khaledhosny eglug org>
Date:   Sun Sep 2 07:07:16 2012 +0200

    Use .format with ngettext
    
    So that the number placeholder can be omitted (e.g. with Arabic first 3
    plural forms), which is not possible with old %-formatting in Python.

 gnomeclocks/app.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gnomeclocks/app.py b/gnomeclocks/app.py
index 0e5af04..8a8515f 100644
--- a/gnomeclocks/app.py
+++ b/gnomeclocks/app.py
@@ -358,7 +358,7 @@ class ClocksToolbar(Gtk.Toolbar):
         if n == 0:
             self.titleLabel.set_markup("(%s)" % _("Click on items to select them"))
         else:
-            msg = ngettext("%d item selected", "%d items selected", n) % (n)
+            msg = ngettext("{0} item selected", "{0} items selected", n).format(n)
             self.titleLabel.set_markup("<b>%s</b>" % (msg))
 
     def _on_selection_changed(self, view):



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