matheuss / google-translate-api

A free and unlimited API for Google Translate :dollar::no_entry_sign:

Home Page:https://npmjs.com/package/google-translate-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to call this API in Jquery or python

artiberde27 opened this issue · comments

We are working Django project. How to call this API in Jquery or python?

Not official reply

First you can access this in javascript by using webpack but there isn't any guides or references for this project, so you need to build your own settings to get webpack build.

Or maybe making an api server for this and migrate it into your service can be possible.

Python: Not available.

You cannot run this on Python by native. I don't have any experiences of Python, but I think there can be a NodeJS or JavaScript launcher module in PIP system.

commented

Use a python version instead?
https://pypi.org/project/googletrans/

As for jquery, you cannot use it directly in browser due to CORS.

I recommend you take a look at the google translate documentation for client libraries.

https://cloud.google.com/translate/docs/reference/libraries

If you do not wish to use a library, google translate has a standard HTTP API/service you can interact with. For python, you'll want to import the "requests" library and make calls according to the API specs for the service here: https://cloud.google.com/translate/docs/apis

Jquery on the other hand seems to be an odd candidate for this request, as it is a library that is unrelated to making HTTP calls, and is more tailored for client-side HTML selection and manipulation. I recommend you talk to a qualified developer familiar with HTTP and public APIs, and potentially consult or hire an architect.