Forum Discussion

Akenefick's avatar
Akenefick
Genius
7 months ago

Integrating Community with Google Translate

Hi We are exploring integrating google translate into our community. So, I had a couple of questions. Google uses Oauth 2.0 as detailed here https://developers.google.com/identity/protocols/oauth2/...
  • luk's avatar
    7 months ago

    I had a look at the docs you linked for Google and it indeed seems overly complicated. I mean an endpoint that does send something to a payed service doesn't need OAuth in my opinion, it just needs a valid API key to associate the request with your account, there is no "identity element" involved to distinguish between various users, that's what OAuth is usually used for in my world... e.g. I'm not seeing the point in going trough all the OAuth hoops for something relatively simple like that...

    but:

    but of course I don't know if you intend to use the Advanced API (v3)? Otherwise you might be able to get around with a regular API key / Bearer token auth, here's how you'd do it: https://stackoverflow.com/a/70656679/4428236 

    If you don't want to bother at all with authentication you could try and get inspired by this https://github.com/Stichoza/google-translate-php/blob/master/src/GoogleTranslate.php , it basically "abuses" translate.google.com (the web version) to translate stuff for free 😉.