We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes the translator returns a list sometimes just a text. Steps to reproduce:
from google_trans_new import google_translator translator = google_translator()
from google_trans_new import google_translator
translator = google_translator()
print (translator.translate('ALL', lang_tgt='fr')) produces: ['TOUT', 'TOUTE']
print (translator.translate('ALL', lang_tgt='fr'))
while: print (translator.translate('In Progress', lang_tgt='fr')) produces: "En cours"
print (translator.translate('In Progress', lang_tgt='fr'))
Is there a way for more consistend handling (e.g. by default allways return 1st and have alternative translations only on demand)?
Thx & best regards,
Ben
The text was updated successfully, but these errors were encountered:
I fixed it now for my purpose like this:
def clean(_translation): if(type(_translation)==list): return _translation[0] else: return _translation
Maybe something like that could become a common feture?
Sorry, something went wrong.
No branches or pull requests
Sometimes the translator returns a list sometimes just a text.
Steps to reproduce:
from google_trans_new import google_translator
translator = google_translator()
print (translator.translate('ALL', lang_tgt='fr'))
produces: ['TOUT', 'TOUTE']
while:
print (translator.translate('In Progress', lang_tgt='fr'))
produces: "En cours"
Is there a way for more consistend handling (e.g. by default allways return 1st and have alternative translations only on demand)?
Thx & best regards,
Ben
The text was updated successfully, but these errors were encountered: