andreicristianpetcu / google_translate_this

This WebExtension translates the current page with Google Translate. It does so on demand so it does not change the page unless the user selected this. It is fast, light and privacy friendly.
https://github.com/andreicristianpetcu/google_translate_this/releases
GNU General Public License v3.0
190 stars 10 forks source link

Can save the remote code to the extension? #20

Open nY381v opened 4 years ago

nY381v commented 4 years ago

Here's a piece of translation function code that I use a lot. I extracted them from web translation, they are very simple and do not require authentication.

I want to know, if google remote code is saved to the extension, just using its translation API (like the following function) also violates AMO policy? Or is the remote code too complex to parse? Or is it against google's rules to use API without authorization?

translate_google(str,to){
    return curl({"url":"https://translate.google.com.hk/translate_a/single?client=gtx&dt=t&ie=utf-8&oe=utf-8&sl=auto&tl=" to,"post":"q=" encode(str)})
}

translate_bing(str,to){
    return curl({"url":"https://www.bing.com/ttranslatev3?isVertical=1&fromLang=auto-detect&to=" to,"post":"&text=" encode(str)})
}
andreicristianpetcu commented 4 years ago

saving google code locally would be copyright infringement

nY381v commented 4 years ago

The google code is very complicated and can't parse it? If you can parse, isn't it possible to build a script with similar functionality? Only need its script, not even the google API, because we can use other translation API(as BING)

Sorry, I won't be programming, maybe a lot of questions are not as simple as I thought.