1

So this is it :

google_trans_new.google_trans_new.google_new_transError: 404 (Not Found) from TTS API. Probable cause: Unknown

from googletrans import Translator

translater = Translator()

out = translater.translate('guten Tag', dest='en')

print(out.text)

This is the code, it is supposed to print good day. (Note: I run it in cmd.)

Mofi
  • 46,139
  • 17
  • 80
  • 143
Mahdi Brahem
  • 11
  • 1
  • 2
  • Your code currently works for me if I use version 4.0.0rc1. See https://stackoverflow.com/a/73882068/3216427 It fails with a different error if I use version 3.0.0. What version are you using? (`pip list | grep googletrans` will tell you if you don't know.) – joanis Oct 29 '22 at 13:26
  • thank u it did work when i unistalled it then reinstalled that version much love – Mahdi Brahem Oct 29 '22 at 23:19
  • Glad to help. Happy translating! – joanis Oct 29 '22 at 23:51
  • In my case `pip install googletrans==4.0.0rc1` didn't make any difference :( – hipoglucido Jan 27 '23 at 18:40

1 Answers1

1

Use deep_translator:

I have not been successful using either googletrans nor google_trans_new. But the good news is deep_translator works seamlessly. You need to install it first:

pip install -U deep-translator

Then import it:

from deep_translator import GoogleTranslator

And use it as follows:

GoogleTranslator(source='auto', target='en').translate("guten Tag")

You should receive:

Good day

Amir Charkhi
  • 768
  • 7
  • 23