Skip to content

Commit

Permalink
lang fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Feb 28, 2012
1 parent 2482d71 commit 46a1cf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ckan/config/middleware.py
Expand Up @@ -168,7 +168,8 @@ def __call__(self, environ, start_response):
cookie_lang = self.get_cookie_lang(environ)
if cookie_lang:
environ['CKAN_LANG'] = cookie_lang
environ['CKAN_LANG_IS_DEFAULT'] = False
default = (cookie_lang == self.default_locale)
environ['CKAN_LANG_IS_DEFAULT'] = default
else:
environ['CKAN_LANG'] = self.default_locale
environ['CKAN_LANG_IS_DEFAULT'] = True
Expand Down
3 changes: 2 additions & 1 deletion ckan/lib/helpers.py
Expand Up @@ -96,7 +96,8 @@ def _add_i18n_to_url(url_to_amend, **kw):
except TypeError:
root = ''
if default_locale:
url = '%s%s' % (root, url_to_amend)
url = url_to_amend[len(root):]
url = '%s%s' % (root, url)
else:
# we need to strip the root from the url and the add it before
# the language specification.
Expand Down

0 comments on commit 46a1cf3

Please sign in to comment.