diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index e1a608d0165..c52317c6c1f 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -22,10 +22,9 @@ from routes import url_for as _routes_default_url_for from alphabet_paginate import AlphaPage from lxml.html import fromstring -from i18n import get_locales -# get_available_locales not used here but passed to template context -from i18n import get_available_locales +import i18n +get_available_locales = i18n.get_available_locales try: from collections import OrderedDict # from python 2.7 @@ -69,7 +68,7 @@ def _add_i18n_to_url(url_to_amend, **kw): default_locale = False locale = kw.pop('locale', None) - allowed_locales = ['default'] + get_locales() + allowed_locales = ['default'] + i18n.get_locales() if locale and locale not in allowed_locales: locale = None if locale: