[ckan-changes] commit/ckan: dread: [lib]: #1443 Fix language detection - error when detected lang is not available.
Bitbucket
commits-noreply at bitbucket.org
Fri Nov 4 17:31:12 UTC 2011
1 new commit in ckan:
https://bitbucket.org/okfn/ckan/changeset/96b5d9af70a7/
changeset: 96b5d9af70a7
branch: release-v1.5
user: dread
date: 2011-11-04 18:26:35
summary: [lib]: #1443 Fix language detection - error when detected lang is not available.
affected #: 1 file
diff -r 1d4065644baaa3e8cb9ab9e8e54a62eed6fb449f -r 96b5d9af70a751d2ea7bd5ee411f102f6f2d571f ckan/lib/i18n.py
--- a/ckan/lib/i18n.py
+++ b/ckan/lib/i18n.py
@@ -160,7 +160,9 @@
locales.append(Locale.parse(session.get('locale')))
else:
# Next try languages in the HTTP_ACCEPT_LANGUAGE header
- locales.append(Locales().negotiate_known_locale(request.languages))
+ locale = Locales().negotiate_known_locale(request.languages)
+ if locale:
+ locales.append(locale)
# Next try the default locale in the CKAN config file
locales.append(Locales().get_default_locale())
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list