I'm trying to catch some type of error when there is no translation.
For example I'm trying to pass a junk word - 'madrdogesssss' in Spanish for translation to English. deepl returns 'madrdogesssss', which isn't a translation, because there is no translation available.
import deepl
from deepl.exceptions import AuthorizationException
from deepl.exceptions import QuotaExceededException
from deepl.exceptions import TooManyRequestsException
try:
translator = deepl.Translator(auth_key=self._api_key)
result = translator.translate_text(self._str_to_translate,
target_lang=self._source_language,
source_lang='EN')
translated_text = result.text
return translated_text
truncated...
After checking https://www.deepl.com/en/translatorfor the same nonsensual word, I noted that it returns more nonsensual words. So nonsensual translations are a feature.
I'm trying to catch some type of error when there is no translation.
For example I'm trying to pass a junk word - 'madrdogesssss' in Spanish for translation to English.
deepl
returns 'madrdogesssss', which isn't a translation, because there is no translation available.