lushan88a / google_trans_new

A free and unlimited python API for google translate.
MIT License
394 stars 171 forks source link

Fix response for multiple sentences #1

Open ik4Rus opened 3 years ago

ik4Rus commented 3 years ago

Hi, first of all thank you for the repo - great work! I noticed that the translation does not work for several sentences (applies to all punctuation marks, like ".", "?", "!", ":", ";"): Current: Only the first sentence is returned.

translator = google_translator(lang_src = 'auto', lang_tgt = 'en', url_suffix = 'https://translate.google.cn')
print(translator.translate('Das ist der erste Satz. Das ist der zweite Satz.'))
> That's the first sentence.

After the adjustment: All sentences are returned.

translator = google_translator(lang_src = 'auto', lang_tgt = 'en', url_suffix = 'https://translate.google.cn')
print(translator.translate('Das ist der erste Satz. Das ist der zweite Satz.'))
> That's the first sentence. That is the second sentence.

I also added a gitignore file :) Greetings from Germany Ingo

lushan88a commented 3 years ago

Hi, Thank you very much for this question! I have fixed this problem. you can try it now. Your friend Lu