diff options
author | 2010-12-14 22:06:02 +0000 | |
---|---|---|
committer | 2010-12-14 22:06:02 +0000 | |
commit | 382ae75774ecfd482ac19c38c0ff34df3f7ddbc8 (patch) | |
tree | be412e5089bac85e0f73168eb2f7788c2839a1dd | |
parent | Fix return. (diff) | |
download | gentoo-ads-382ae75774ecfd482ac19c38c0ff34df3f7ddbc8.tar.gz gentoo-ads-382ae75774ecfd482ac19c38c0ff34df3f7ddbc8.tar.bz2 gentoo-ads-382ae75774ecfd482ac19c38c0ff34df3f7ddbc8.zip |
Disable magic for now.
-rw-r--r-- | gentoo_ads/ads/views.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gentoo_ads/ads/views.py b/gentoo_ads/ads/views.py index d076f57..fe55866 100644 --- a/gentoo_ads/ads/views.py +++ b/gentoo_ads/ads/views.py @@ -17,22 +17,23 @@ 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(',')] +# # 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): - common_langs = set(accept_langs) & set(available_langs) - for _ in accept_langs: - if _ in common_langs: - return _ return settings.DEFAULT_ADS_LANG + #common_langs = set(accept_langs) & set(available_langs) + #for _ in accept_langs: + # if _ in common_langs: + # return _ + #return settings.DEFAULT_ADS_LANG def _trans_ad(ad, accept_langs): for k in settings.TRANS_KEYS: |