diff roundup/i18n.py @ 5477:b0c2307be3d1

applied remaining part of original patch 045 (slightly modified)
author Christof Meerwald <cmeerw@cmeerw.org>
date Mon, 30 Jul 2018 22:09:48 +0100
parents 56c9bcdea47f
children bb364082a14a
line wrap: on
line diff
--- a/roundup/i18n.py	Sun Jul 29 02:45:39 2018 +0100
+++ b/roundup/i18n.py	Mon Jul 30 22:09:48 2018 +0100
@@ -203,8 +203,18 @@
 translation = get_translation()
 # static translation functions
 _ = gettext = translation.gettext
-ugettext = translation.ugettext
+try:
+    # Python 2.
+    ugettext = translation.ugettext
+except AttributeError:
+    # Python 3.
+    ugettext = translation.gettext
 ngettext = translation.ngettext
-ungettext = translation.ungettext
+try:
+    # Python 2.
+    ungettext = translation.ungettext
+except AttributeError:
+    # Python 3.
+    ungettext = translation.ngettext
 
 # vim: set filetype=python sts=4 sw=4 et si :

Roundup Issue Tracker: http://roundup-tracker.org/