fix(client): pronunciation is None for some languages (#175)
This commit is contained in:
parent
704e8617a0
commit
312f36ad87
@ -186,6 +186,12 @@ class Translator:
|
||||
except Exception: # pragma: nocover
|
||||
pass
|
||||
|
||||
if pron is None:
|
||||
try:
|
||||
pron = data[0][1][2]
|
||||
except: # pragma: nocover
|
||||
pass
|
||||
|
||||
if dest in EXCLUDES and pron == origin:
|
||||
pron = translated
|
||||
|
||||
|
@ -29,6 +29,12 @@ def test_pronunciation(translator):
|
||||
assert result.pronunciation == 'Kon\'nichiwa.'
|
||||
|
||||
|
||||
def test_pronunciation_issue_175(translator):
|
||||
result = translator.translate('Hello', src='en', dest='ru')
|
||||
|
||||
assert result.pronunciation is not None
|
||||
|
||||
|
||||
def test_latin_to_english(translator):
|
||||
result = translator.translate('veritas lux mea', src='la', dest='en')
|
||||
assert result.text == 'The truth is my light'
|
||||
|
Loading…
Reference in New Issue
Block a user