Fix: check availability of both source and destination language
refs #2
This commit is contained in:
parent
7a59b8a82a
commit
6a101f4dad
@ -74,6 +74,11 @@ Advanced usage:
|
||||
result.append(translated)
|
||||
return result
|
||||
|
||||
if dest not in LANGUAGES.keys():
|
||||
raise ValueError('incorrect destination language')
|
||||
if src != 'auto' and src not in LANGUAGES.keys():
|
||||
raise ValueError('incorrect source language')
|
||||
|
||||
result = ''
|
||||
sess = agent() # acquire requests session
|
||||
origin = text
|
||||
|
Loading…
Reference in New Issue
Block a user