If you want to translate content from programmatically, you can use dashdash for it. Here’s the kind of app you can easily build:
Here’s what we did:
- Get a Google API key
- Build the app
Get an API key
You first need to set up a GCP Project here. Second, in your GCP Console, follow
APIs & Services on the left-hand menu, then click the
ENABLE APIS AND SERVICES button. Then look for
Cloud Translation API. You find your API key in the
Credentials tab. Use it to activate the integration in dashdash’s Integrations menu.
Build the app
OK, now the fun part!
We first set the input parameter for “Target language” in B1 (“es” for Spanish in our example).
We create a table with the columns Query, Request, Result and Source Language. Query is just the input text we want to translate.
Then, we add the formulas:
And that’s it! The API automatically detects the source language of our input, which we can see in column D.
Note: In this example, we are using Google, but feel free to check out our DeepL and Microsoft integrations. Google currently charges 20$ for every 1M translated characters and gives you the first 300$ credit for free.
In case you don’t want to use our integration but talk directly to the Google Translate API, you can simply use our GET formula, e.g.:
=GET("https://translation.googleapis.com/language/translate/v2?q="&A4&"&target="&$B$1&"&key=[YOUR API KEY]")