Skip to content

Google Translate

The Google Translate modules enable you to translate a text or perform an API call using Google Translate.

Getting Started with Google Translate

Prerequisites

Note

The module dialog fields that are displayed in bold (in the Ibexa Connect scenario, not in this documentation article) are mandatory!

Connecting Google Translate to Ibexa Connect

  1. Go to Ibexa Connect and open the Google Translate module's Create a connection dialog.

  2. Enter a name for the connection to the Connection name field and click Continue.

    61f26fc296788.gif

    After you click the Continue button, Ibexa Connect will redirect you to the Google Translate website where you will be prompted to grant Ibexa Connect access to your account.

    The connection has been established. You can proceed with setting up the module.

    61f26fc4ef2cc.png

    Confirm the dialog by clicking the Allow button.

Actions

Translate a Text

Translates an entered text into the selected target language.

Source Language (From) Select the language you want to translate the text from.If you select the Detect language option, detected characters will be deducted from your daily quota. See Google Translate pricing.
Target Language (To) Select the language you want to translate the text to.
Text to Translate Enter the text you want to translate.
Format Select the format of the source text.
Model Select the translation model. Can be either base to use the Phrase-Based Machine Translation (PBMT) model, or the Neural Machine Translation (NMT) model. If omitted, then NMT is used. If the model is NMT, and the requested language translation pair is not supported for the NMT model, then the request is translated using the PBMT model.

Make an API Call

Allows you to perform a custom API call.

URL

Enter a path relative to https://www.googleapis.com/language/translate.For example: /v2/detect.

For the list of available endpoints, refer to the Google Translate APIs & References Documentation.

Method

Select the HTTP method you want to use:

GET

to retrieve information for an entry.

POST

to create a new entry.

PUT

to update/replace an existing entry.

PATCH

to make a partial entry update.

DELETE

to delete an entry.

Headers

Enter the desired request headers. You don't have to add authorization headers; we added those for you.

Query String

Enter the request query string.

Body

Enter the body content for your API call.

Example of Use - Detect Language

The following API call returns the language code of the specified text:

URL:

/v2/detect

Method:

GET

Query String:

Key q

Value

<the text you want to detect the language for>

61f26fc5e592a.png

The result can be found in the module's Output under Bundle > Body > detections.

In our example, "de" language (German) has been detected:

61f26fc6eebd0.png