[pitivi: 5/27] settings.py: use ngettext for plurals in getAudioDescription



commit eee36cc81521adc79f8b3089a09464a1d8200772
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Thu Dec 30 14:25:18 2010 -0500

    settings.py: use ngettext for plurals in getAudioDescription
    
    Fixes bug #637497

 pitivi/settings.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 10a9887..a236766 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -31,6 +31,7 @@ from ConfigParser import SafeConfigParser, ParsingError
 import xdg.BaseDirectory as xdg_dirs  # Freedesktop directories spec
 
 from gettext import gettext as _
+from gettext import ngettext
 
 from pitivi.signalinterface import Signallable
 from pitivi.encode import available_combinations, \
@@ -534,10 +535,13 @@ class ExportSettings(Signallable, Loggable):
 
     def getAudioDescription(self):
         """ Returns a human-readable markup-ed string describing the audio properties """
-        res = _("%(channels)d channels at %(frequency)d Hz (%(depth)d bits)" % \
+        res = ngettext("%(channels)d channel at %(frequency)d Hz (%(depth)d bits)",
+            "%(channels)d channels at %(frequency)d Hz (%(depth)d bits)",
+            self.audiochannels)
+        res = res % \
                 {"channels": self.audiochannels,
                 "frequency": self.audiorate,
-                "depth": self.audiodepth})
+                "depth": self.audiodepth}
         if self.aencoder is not None:
             res += " <i>(%s)</i>" % self.aencoder
 



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