[Mpuls-commits] r4567 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 3 17:36:48 CET 2011


Author: torsten
Date: 2011-02-03 17:36:47 +0100 (Thu, 03 Feb 2011)
New Revision: 4567

Modified:
   base/trunk/mpulsweb/lib/translation.py
Log:
* mpulsweb/lib/translation.py (_ungettext): Handle "0" as plural form


Modified: base/trunk/mpulsweb/lib/translation.py
===================================================================
--- base/trunk/mpulsweb/lib/translation.py	2011-02-03 16:24:15 UTC (rev 4566)
+++ base/trunk/mpulsweb/lib/translation.py	2011-02-03 16:36:47 UTC (rev 4567)
@@ -75,15 +75,19 @@
     domains.append('mpulsweb')
 
     for do in domains:
+        print do
         for di in dirs:
+            print di
             translator = _get_translator(lang, do, di)
-            if translator is not None: 
+            if translator is not None:  
                 translated = translator.ungettext(singular, plural, n)
-                if n > 1:
+                # handle 0 as plural 
+                if n > 1 or n == 0:
                     if translated != plural:
                         # Seems to be translated
                         return translated
                 else:
+
                     if translated != singular:
                         # Seems to be translated
                         return translated



More information about the Mpuls-commits mailing list