Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It turned out that the following patch fixes the problem:

https://github.com/lushan88a/googletransnew/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

After applying the fix you can translate a text like follows:

from google_trans_new import google_translator

# Text to translate
text = "Hello, how are you?"

target_language = "es"
translator = google_translator()
translation = translator.translate(text, lang_tgt=target_language)

print(f"Original text: {text}")
print(f"Translation: {translation}")

It turned out that the following patch fixes the problem:

https://github.com/lushan88a/googletransnew/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

After applying the fix you can translate a text like follows:

from google_trans_new import google_translator

# Text to translate
text = "Hello, how are you?"

target_language = "es"
translator = google_translator()
translation = translator.translate(text, lang_tgt=target_language)

print(f"Original text: {text}")
print(f"Translation: {translation}")

It turned out that the following patch fixes the problem:

https://github.com/lushan88a/googletransnew/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

https://github.com/lushan88a/google_trans_new/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

After applying the fix you can translate a text like follows:

from google_trans_new import google_translator

# Text to translate
text = "Hello, how are you?"

target_language = "es"
translator = google_translator()
translation = translator.translate(text, lang_tgt=target_language)

print(f"Original text: {text}")
print(f"Translation: {translation}")

It turned out that the following patch fixes the problem:

https://github.com/lushan88a/google_trans_new/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

After applying the fix you can translate a text like follows:

from google_trans_new import google_translator

# Text to translate
text = "Hello, how are you?"

target_language = "es"
translator = google_translator()
translation = translator.translate(text, lang_tgt=target_language)

print(f"Original text: {text}")
print(f"Translation: {translation}")

It turned out that the following patch fixes the problem:problem. If you installed the package via git, you need implement the changes directly in the google_trans_new.py in your Python site-packages location:

https://github.com/lushan88a/google_trans_new/pull/58/commits/aa4faaa9c322e8772e6a1cbad472e94af7405d64

After applying the fix you can translate a text like follows:

from google_trans_new import google_translator

# Text to translate
text = "Hello, how are you?"

target_language = "es"
translator = google_translator()
translation = translator.translate(text, lang_tgt=target_language)

print(f"Original text: {text}")
print(f"Translation: {translation}")