funkyremi / vscode-google-translate

Translate text right in your code
MIT License
134 stars 39 forks source link

Could you extend this plugin to also support other web-based or local translation API? #58

Open Naereen opened 3 years ago

Naereen commented 3 years ago

Hello there :wave: ! Congrats and thanks for your nice work @funkyremi! It's a very nice plugin! This plugin is in my list of favorite VSCode plugins since the day I installed and tried it! (https://besson.link/visualstudiocode.en.html#the-best-plugins)

I was wondering, it shouldn't be too hard to extend a little bit the code and allow users to configure which online web-based translation API they prefer to use? Google Translate is not the only one, there are DeepL (https://www.deepl.com/translator) and LibreTranslate (https://libretranslate.com/).

That way, the plugin can be more robust if Google Translate suddenly breaks or get suspended (Google has a long history of suspended projects...), and privacy of users could be preserved (or at least, improved) if they want to switch to LibreTranslate (as its destop version, Argos Translate, can run entirely offline and locally!).

I won't have time to do it myself, but I can help remotely by testing, giving feedback or ideas. What do you think?

Thanks in advance! -- @Naereen from France

funkyremi commented 3 years ago

Excellent idea :-) It’s not too hard but it will take time and I don’t have enough time to spend on it right now. I’ll keep this open with a feature tag and if someone wants to work on it, feel free.

Naereen commented 3 years ago

Great :rocket: ! I really don't have time, but maybe in August I could have one or two interns coding on side projects with me, so I'll keep this in mind!

oshliaer commented 3 years ago

For the best solution we need to declare an abstract class which declares translate method. A wrappers for the APIs or a decorator would great too.

SamHasler commented 3 years ago

If anyone does work on this, could you please also consider also adding support for the Microsoft / Azure translator API

https://azure.microsoft.com/en-us/services/cognitive-services/translator/#overview

It has a 2M character per month limit on it's Free tier: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator/

Language Support: https://docs.microsoft.com/en-us/azure/cognitive-services/translator/language-support