aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: