diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2010-12-14 22:09:53 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2010-12-14 22:09:53 +0000 |
commit | d311a501deb389375faca31d910ff6521ff859e2 (patch) | |
tree | c3f3eb382f8f9fbc328390ceeff71fc343186c50 | |
parent | Enable first part. (diff) | |
download | gentoo-ads-d311a501deb389375faca31d910ff6521ff859e2.tar.gz gentoo-ads-d311a501deb389375faca31d910ff6521ff859e2.tar.bz2 gentoo-ads-d311a501deb389375faca31d910ff6521ff859e2.zip |
Include base split code.
-rw-r--r-- | gentoo_ads/ads/views.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gentoo_ads/ads/views.py b/gentoo_ads/ads/views.py index 99cd21d..03acc1b 100644 --- a/gentoo_ads/ads/views.py +++ b/gentoo_ads/ads/views.py @@ -17,14 +17,15 @@ def serve_ads(request): def _build_lang_array(request): accept_langs = [settings.DEFAULT_ADS_LANG] -# if META_LANG_KEY in request.META: -# # Ignore priority for now, hopefully they are in the correct order -# # TODO: reorder per HTTP language RFC -# accept_langs = [re.sub(';q=[0-9.]+', '' ,_).strip() for _ in request.META[META_LANG_KEY].split(',')] -# # Handle dialects -# for _ in accept_langs: -# if '-' in _: -# accept_langs += [ re.sub('[-_][_-a-zA-Z0-9]+', '', _) ] + if META_LANG_KEY in request.META: + # Ignore priority for now, hopefully they are in the correct order + # TODO: reorder per HTTP language RFC + #accept_langs = [re.sub(';q=[0-9.]+', '' ,_).strip() for _ in request.META[META_LANG_KEY].split(',')] + accept_langs = [_.strip() for _ in request.META[META_LANG_KEY].split(',')] + # Handle dialects + #for _ in accept_langs: + # if '-' in _: + # accept_langs += [ re.sub('[-_][_-a-zA-Z0-9]+', '', _) ] return accept_langs def _match_langs(accept_langs, available_langs): |