Is it possible to stop the googletrans module in python to survive a translation to French?

33 views Asked by At

When using the googletrans module in python and I attempt to translate a dictionary (with around 50-60 words) to specific languages including French I get this error:

translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5]))


This is the code I use to make my translations:

for key in translationsDb:
    for i, text in enumerate(translationsDb[key]):
        if lang != "en":
            transtext = translator.translate(translationsDb[key][i], dest = languages[lang.casefold()], src = "en")
            transDict[key][i] = transtext.text
        else:
            transDict[key][i] = text
0

There are 0 answers