-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
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
Improve (default) google translator #110
Comments
Thanks for your feedback. This would have two problems. 1, the separator ";" may appear in the text being translated and it is impossible to assume what the user's text is. 2, For long sentences, this may lead to a reduction in the accuracy of the translated result. This is because there are many words blended together, affecting the judgment of the translation context. Discussions are welcome. |
";" separator is just an example, maybe some other symbol would be better. Take a look on this 😄 : One could argue that the translation would be even better - bigger context, better translation. Google translates whole web pages this way. But that would have to be tested of course, either of us might be right. At the very least this technique could be at least used to translate multiple single word strings. I am planning to do some simple script in python to check this and share with you my results (for languages I know at least). Could you give me some hint on how to do this? I mean communication with google translate, not python-specific stuff. Or point me to some place where I can get needed info? |
To communicate with Google Translate without an API KEY, you mainly need to generate the corresponding token, which may help you: GoogleToken. Alternatively, the web version can be used directly to compare the translation results of individual sentences and sentences mixed with other words separately. |
Google translator allows to provide 5000 words. It might be good idea to provide many strings at once, separated by semicolon (or a dot?) + space.
I have an example:
converts to
Easy; Medium; Hard; Very hard
and result on translate google:
https://translate.google.com/?sl=en&tl=pl&text=Easy%3BMedium%3BHard%3BVery%20hard&op=translate
It not only requires less api calls but also gives better results. Giving some context to the separated words. In the case above, when translating to my language (and some other languages too) using your plugin
hard
was translated to a word meaning "solid, firm, rigid", not the correct one meaning "difficult"The text was updated successfully, but these errors were encountered: