OiWorld / MindTheWord

An extension for Google Chrome that helps people learn new languages while they browse the web.
43 stars 47 forks source link

Use the alternative API for Google Translate #198

Open severen opened 8 years ago

severen commented 8 years ago

There is an alternative Google Translate API that is free and is internally used by the Google Translate service in Chromium. More information is in this post (I'm not the author): https://ctrlq.org/code/19909-google-translate-api

Here's an example query, translating English into Norwegian: https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=no&dt=t&q=Hello%20world

ankit-m commented 8 years ago

@SShrike I don't think we should use such a trick. Primarily for two reasons:

  1. It is a hack and Google can any time just close the end point.
  2. It is not the correct way of using services
ceilican commented 8 years ago

I essentially agree with the points raised by @ankit-m, but I wouldn't immediately reject the idea.

Regarding point 2: is it explicitly said anywhere that we shouldn't use this free alternative Google Translate API? Would we be violating any terms of service if we used? If yes, then we should not use it. And that is the end of the story. But we should check this. @SShrike, could you investigate this and provide us some evidence that it would be legal (or at least that it would not be illegal) to use this free alternative?

If we find out that point 2 is not actually a problem, then we should consider point 1. To protect against the sudden closure of the free API, we would have to offer it as a 4th alternative inside Mind The Word, and not as a replacement to the paid Google API. And we would have to clearly indicate to users that this free API is unstable and may stop working at any time.

severen commented 8 years ago

@SShrike, could you investigate this and provide us some evidence that it would be legal (or at least that it would not be illegal) to use this free alternative?

Sure thing, I'll take a look soon.

To protect against the sudden closure of the free API, we would have to offer it as a 4th alternative inside Mind The Word, and not as a replacement to the paid Google API.

I should have been clearer, that was my intention. Not a replacement, but an addition.

severen commented 8 years ago

I can't find anything that suggests it is either against or not against the TOS, however I'd say it most likely is, since it allows someone to bypass Google's paid Translate API solution.

Now, you could add support for it along with a warning once you enable it that it could possibly be against TOS and support for it might break at any time.

ceilican commented 7 years ago

however I'd say it most likely is, since it allows someone to bypass Google's paid Translate API solution.

Do the Chromium developers have an agreement with Google to use this free API in their Google Translate service?

Now, you could add support for it along with a warning once you enable it that it could possibly be against TOS and support for it might break at any time.

I would agree to have that, but I have no time to implement it the short-term future. Would you like to do it and submit a pull request?

severen commented 7 years ago

Would you like to do it and submit a pull request?

Hmm, I'll have a look at it, but I've never really looked at how a Chrome plugin works. Any pointers?

ceilican commented 7 years ago

This file contains instructions on how to contribute to Mind The Word.

You don't need to know much about Chrome's plugin API, because this is already done. You would have to add an option for the Free Google API in the translation tab of the options page, update the corresponding controller script, create a service for the Free Google API and connect the new service in the "getTranslator" method of mtw.js.

It seems like a lot, but all these steps are tiny, in fact.

severen commented 7 years ago

Sorry for not getting around to this sooner, I have exams to prepare for etc., so I forgot about this and it went on the backburner. I might be able to squeeze something out this weekend.

ceilican commented 7 years ago

No worries... And thanks in advance for any contribution that you might be able to produce during the weekend.

boro741 commented 7 years ago

@ceilican if @SShrike is not working on this issue can I take up this work. And I think you have provided enough information on how do I contribute so I'll be starting to work as soon as you respond.

ceilican commented 7 years ago

@boro741 , wait one or two days for @SShrike to reply whether he is working on his issue. If he doesn't reply, we can assume that he isn't working on it. And if he isn't working on it, it would be great if you could do it.

process9 commented 7 years ago

I agree with Ankit-m, as using these tricks can be problematic for the websites. For those looking for language translation API for their online store should look for some permanent and effective solutions. There are companies like Process 9 that have developed dedicated software for the businesses only. If you target Indian audience and want easy language translation for your website, you can install their software and make it quick, error-free and effective for your online customers. Further, when using Process Nine's language translation API, you don't need to make changes in your website. You can install the software with some steps and can translate the language quickly.