Skip to content

Commit aa8a4f7

Browse files
committed
i18n: Remove Python 2.3 compatibility
1 parent 0f5f512 commit aa8a4f7

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Fixed:
1616
- Small bug-fix in SQL backends: An query (e.g. in a html menu) with a
1717
where-clause that always evaluates to false now will not raise a
1818
traceback. (Ralf Schlatterbeck)
19+
- Remove Python 2.3 compatibility code for i18n (anatoly techtonik)
1920

2021
2013-07-06: 1.5.0
2122

roundup/i18n.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,8 @@
6161
# Roundup text domain
6262
DOMAIN = "roundup"
6363

64-
if hasattr(gettext_module.GNUTranslations, "ngettext"):
65-
# gettext_module has everything needed
66-
RoundupNullTranslations = gettext_module.NullTranslations
67-
RoundupTranslations = gettext_module.GNUTranslations
68-
else:
69-
# prior to 2.3, there was no plural forms. mix simple emulation in
70-
class PluralFormsMixIn:
71-
def ngettext(self, singular, plural, count):
72-
if count == 1:
73-
_msg = singular
74-
else:
75-
_msg = plural
76-
return self.gettext(_msg)
77-
def ungettext(self, singular, plural, count):
78-
if count == 1:
79-
_msg = singular
80-
else:
81-
_msg = plural
82-
return self.ugettext(_msg)
83-
class RoundupNullTranslations(
84-
gettext_module.NullTranslations, PluralFormsMixIn
85-
):
86-
pass
87-
class RoundupTranslations(
88-
gettext_module.GNUTranslations, PluralFormsMixIn
89-
):
90-
pass
64+
RoundupNullTranslations = gettext_module.NullTranslations
65+
RoundupTranslations = gettext_module.GNUTranslations
9166

9267
def find_locales(language=None):
9368
"""Return normalized list of locale names to try for given language

0 commit comments

Comments
 (0)