summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-06-23 18:39:42 +0000
committerGerrit Code Review <review@openstack.org>2014-06-23 18:39:42 +0000
commit60f4b78cba329c75b82e79ff0fa4e5d6940050a0 (patch)
tree964082e299b81aa742959b96e12d563bd033d3d6
parent57e22f17e92b4bdf8d7227fbbc73a6d2a2f12a9b (diff)
parent324a99cd7969d9081dd74b4decdb4f61a6eae6e1 (diff)
downloadoslo-i18n-60f4b78cba329c75b82e79ff0fa4e5d6940050a0.tar.gz
Merge "Remove Babel version workaround code"
-rw-r--r--oslo/i18n/gettextutils.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/oslo/i18n/gettextutils.py b/oslo/i18n/gettextutils.py
index 6600892..97900a6 100644
--- a/oslo/i18n/gettextutils.py
+++ b/oslo/i18n/gettextutils.py
@@ -73,25 +73,13 @@ def get_available_languages(domain):
# NOTE(mrodden): en_US should always be available (and first in case
# order matters) since our in-line message strings are en_US
language_list = ['en_US']
- # NOTE(luisg): Babel <1.0 used a function called list(), which was
- # renamed to locale_identifiers() in >=1.0, the requirements master list
- # requires >=0.9.6, uncapped, so defensively work with both. We can remove
- # this check when the master list updates to >=1.0, and update all projects
- list_identifiers = (getattr(localedata, 'list', None) or
- getattr(localedata, 'locale_identifiers'))
- locale_identifiers = list_identifiers()
-
+ locale_identifiers = localedata.locale_identifiers()
language_list.extend(language for language in locale_identifiers
if find(language))
- # NOTE(luisg): Babel>=1.0,<1.3 has a bug where some OpenStack supported
- # locales (e.g. 'zh_CN', and 'zh_TW') aren't supported even though they
- # are perfectly legitimate locales:
- # https://github.com/mitsuhiko/babel/issues/37
- # In Babel 1.3 they fixed the bug and they support these locales, but
- # they are still not explicitly "listed" by locale_identifiers().
- # That is why we add the locales here explicitly if necessary so that
- # they are listed as supported.
+ # In Babel 1.3, locale_identifiers() doesn't list some OpenStack supported
+ # locales (e.g. 'zh_CN', and 'zh_TW') so we add the locales explicitly if
+ # necessary so that they are listed as supported.
aliases = {'zh': 'zh_CN',
'zh_Hant_HK': 'zh_HK',
'zh_Hant': 'zh_TW',