[fix] is_valid_lang fixed for new languages.py + dictzone engine encoding

This commit is contained in:
potato 2017-06-15 10:51:09 +02:00 committed by Adam Tauber
parent b50c89f503
commit 9b82cb1908
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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