aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-12-14 22:08:12 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-12-14 22:08:12 +0000
commit17cd2752b45c0ac736fde4139dc0ad2323f52832 (patch)
tree180c1c14ac8b7cbbaee31da5e0a8f42e1b1ded79
parentDisable magic for now. (diff)
downloadgentoo-ads-17cd2752b45c0ac736fde4139dc0ad2323f52832.tar.gz
gentoo-ads-17cd2752b45c0ac736fde4139dc0ad2323f52832.tar.bz2
gentoo-ads-17cd2752b45c0ac736fde4139dc0ad2323f52832.zip
Enable first part.
-rw-r--r--gentoo_ads/ads/views.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gentoo_ads/ads/views.py b/gentoo_ads/ads/views.py
index fe55866..99cd21d 100644
--- a/gentoo_ads/ads/views.py
+++ b/gentoo_ads/ads/views.py
@@ -28,12 +28,13 @@ def _build_lang_array(request):
return accept_langs
def _match_langs(accept_langs, available_langs):
- 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
+ lang = settings.DEFAULT_ADS_LANG
+ common_langs = set(accept_langs) & set(available_langs)
+ for _ in accept_langs:
+ if _ in common_langs:
+ lang = _
+ break
+ return lang
def _trans_ad(ad, accept_langs):
for k in settings.TRANS_KEYS: