You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

translate()

Usage

translate(text, sourceLanguage, targetLanguage[, translationProvider])

Description

Translates the given text via the a translation API.
Supported translation providers:

  • google (Google Cloud Translation API, default)
  • deepl (DeepL REST API)

Note

An API Key has to be configured in structr.conf.
See the documentation on the Translation module for more info.

Example

${translate("Structr is awesome", "en", "de")}

returns

Structr ist großartig

Search results for "translate()"

translate()

Translates the given text via the a translation API.
Supported translation providers:

  • google (Google Cloud Translation API, default)
  • deepl (DeepL REST API)
translate(text, sourceLanguage, targetLanguage [, translationProvider] )