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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 30 15:55:54 CET 2010


Author: torsten
Date: 2010-11-30 15:55:53 +0100 (Tue, 30 Nov 2010)
New Revision: 4275

Modified:
   base/trunk/mpulsweb/lib/translation.py
Log:
* mpulsweb/lib/translation.py (_ungettext): Issue1416: Fixed
	translation function for "ungettext".


Modified: base/trunk/mpulsweb/lib/translation.py
===================================================================
--- base/trunk/mpulsweb/lib/translation.py	2010-11-30 11:00:38 UTC (rev 4274)
+++ base/trunk/mpulsweb/lib/translation.py	2010-11-30 14:55:53 UTC (rev 4275)
@@ -79,10 +79,15 @@
             translator = _get_translator(lang, do, di)
             if translator is not None: 
                 translated = translator.ungettext(singular, plural, n)
-                if translated != singular:
-                    # Seems to be translated
-                    return translated
-    return value
+                if n > 1:
+                    if translated != plural:
+                        # Seems to be translated
+                        return translated
+                else:
+                    if translated != singular:
+                        # Seems to be translated
+                        return translated
+    return translated
 
 def _get_translator(lang, domain='mpulsweb', dir=None, **kwargs):
     """Utility method to get a valid translator object from a language



More information about the Mpuls-commits mailing list