nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.61k stars 186 forks source link

MyMemoryTranslator does not return all results even when requested to do so. #167

Closed yotama9 closed 2 years ago

yotama9 commented 2 years ago

Description

When I add return_all to the translation request, I don't get multiple result. For example:

>>> from deep_translator import MyMemoryTranslator as t
>>> t(source='en', target='it').translate('child',return_all=True)
'segnalazione'

What I Did

I looked through the source code, I see that in line 77 in the mymemory.py the function will return the result that is available in translation regardless if the flag return_all is set to True or False I believe that this will fix the issue, but I'm not sure if this might break something else.

nidhaloff commented 2 years ago

Thanks for opening the issue. This is definitely a bug. Line 79 should be just like line 85. If you want, you can create the PR for this issue and I will accept it ;)

yotama9 commented 2 years ago

I'm sorry, but my github-foo is virtually 0. Create a PR means?

Vincent-Stragier commented 2 years ago

Hi @yotama9,

PR is the abbreviation of Pull requests. First you have to create a fork to be able to edit the source code, and then you can create a pull request with your changes (see: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).

Best, Vincent S.

nidhaloff commented 2 years ago

I'm sorry, but my github-foo is virtually 0. Create a PR means?

It's ok I will do the fix myself since I have some time now. Take a look to @Vincent-Stragier 's reply for an answer to your question