on master help sign in
[fix] is_valid_lang fixed for new languages.py + dictzone engine encoding
commit9b82cb1908e2e879ba8fcd067cdfb073c5839932 authorpotato <hammerl.laszlo@gmail.com> dateThu 15 Jun 2017, 10:51 (9 years ago) parentb50c89f
2 files changed+3−3
searx/engines/dictzone.py+1−1 searx/utils.py+2−2
searx/engines/dictzone.py+1−1
@@ -37,7 +37,7 @@ def request(query, params):
3737
3838 params['url'] = url.format(from_lang=from_lang[2],
3939 to_lang=to_lang[2],
40− query=query)
40+ query=query.decode('utf-8'))
4141
4242 return params
4343
searx/utils.py+2−2
@@ -295,12 +295,12 @@ def is_valid_lang(lang):
295295 if is_abbr:
296296 for l in language_codes:
297297 if l[0][:2] == lang.lower():
298− return (True, l[0][:2], l[1].lower())
298+ return (True, l[0][:2], l[3].lower())
299299 return False
300300 else:
301301 for l in language_codes:
302302 if l[1].lower() == lang.lower():
303− return (True, l[0][:2], l[1].lower())
303+ return (True, l[0][:2], l[3].lower())
304304 return False
305305
306306