Skip to content

Commit d26b4f8

Browse files
committed
fix infinite recursion in Python3
1 parent 80afa32 commit d26b4f8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

roundup/cgi/TranslationService.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ def translate(self, domain, msgid, mapping=None,
3030
_msg = TALInterpreter.interpolate(_msg, mapping)
3131
return _msg
3232

33-
def gettext(self, msgid):
34-
msgid = us2u(msgid)
35-
msgtrans=self.ugettext(msgid)
36-
return u2s(msgtrans)
37-
38-
def ngettext(self, singular, plural, number):
39-
singular = us2u(singular)
40-
plural = us2u(plural)
41-
msgtrans=self.ungettext(singular, plural, number)
42-
return u2s(msgtrans)
33+
if not _py3:
34+
def gettext(self, msgid):
35+
msgid = us2u(msgid)
36+
msgtrans=self.ugettext(msgid)
37+
return u2s(msgtrans)
38+
39+
def ngettext(self, singular, plural, number):
40+
singular = us2u(singular)
41+
plural = us2u(plural)
42+
msgtrans=self.ungettext(singular, plural, number)
43+
return u2s(msgtrans)
4344

4445
class TranslationService(TranslationServiceMixin, i18n.RoundupTranslations):
4546
pass

0 commit comments

Comments
 (0)