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
|
except Exception: # pragma: nocover
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if pron is None:
|
||||||
|
try:
|
||||||
|
pron = data[0][1][2]
|
||||||
|
except: # pragma: nocover
|
||||||
|
pass
|
||||||
|
|
||||||
if dest in EXCLUDES and pron == origin:
|
if dest in EXCLUDES and pron == origin:
|
||||||
pron = translated
|
pron = translated
|
||||||
|
|
||||||
|
@ -29,6 +29,12 @@ def test_pronunciation(translator):
|
|||||||
assert result.pronunciation == 'Kon\'nichiwa.'
|
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):
|
def test_latin_to_english(translator):
|
||||||
result = translator.translate('veritas lux mea', src='la', dest='en')
|
result = translator.translate('veritas lux mea', src='la', dest='en')
|
||||||
assert result.text == 'The truth is my light'
|
assert result.text == 'The truth is my light'
|
||||||
|
Loading…
Reference in New Issue
Block a user