mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[fix] is_valid_lang fixed for new languages.py + dictzone engine encoding
This commit is contained in:
parent
b50c89f503
commit
9b82cb1908
@ -37,7 +37,7 @@ def request(query, params):
|
||||
|
||||
params['url'] = url.format(from_lang=from_lang[2],
|
||||
to_lang=to_lang[2],
|
||||
query=query)
|
||||
query=query.decode('utf-8'))
|
||||
|
||||
return params
|
||||
|
||||
|
@ -295,12 +295,12 @@ def is_valid_lang(lang):
|
||||
if is_abbr:
|
||||
for l in language_codes:
|
||||
if l[0][:2] == lang.lower():
|
||||
return (True, l[0][:2], l[1].lower())
|
||||
return (True, l[0][:2], l[3].lower())
|
||||
return False
|
||||
else:
|
||||
for l in language_codes:
|
||||
if l[1].lower() == lang.lower():
|
||||
return (True, l[0][:2], l[1].lower())
|
||||
return (True, l[0][:2], l[3].lower())
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user