Mercurial > p > roundup > code
diff roundup/i18n.py @ 4813:a072b35d0606
i18n: Remove Python 2.3 compatibility
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Sun, 25 Aug 2013 08:07:59 +0300 |
| parents | 6e3e4f24c753 |
| children | 6102252d3a8a |
line wrap: on
line diff
--- a/roundup/i18n.py Sat Aug 24 10:42:34 2013 +0300 +++ b/roundup/i18n.py Sun Aug 25 08:07:59 2013 +0300 @@ -61,33 +61,8 @@ # Roundup text domain DOMAIN = "roundup" -if hasattr(gettext_module.GNUTranslations, "ngettext"): - # gettext_module has everything needed - RoundupNullTranslations = gettext_module.NullTranslations - RoundupTranslations = gettext_module.GNUTranslations -else: - # prior to 2.3, there was no plural forms. mix simple emulation in - class PluralFormsMixIn: - def ngettext(self, singular, plural, count): - if count == 1: - _msg = singular - else: - _msg = plural - return self.gettext(_msg) - def ungettext(self, singular, plural, count): - if count == 1: - _msg = singular - else: - _msg = plural - return self.ugettext(_msg) - class RoundupNullTranslations( - gettext_module.NullTranslations, PluralFormsMixIn - ): - pass - class RoundupTranslations( - gettext_module.GNUTranslations, PluralFormsMixIn - ): - pass +RoundupNullTranslations = gettext_module.NullTranslations +RoundupTranslations = gettext_module.GNUTranslations def find_locales(language=None): """Return normalized list of locale names to try for given language
