Skip to content

Translate

Plugin ID: eca_translate

Available since: 1.1.0

Translate a given value, and store the translated value as a token.

Fields

Name of token — config key: token_name

The translation result will be stored in this token. Please provide the token name only, without brackets.

Type: textfield · Required: no · Default: empty string

Value to translate — config key: value

Type: textarea · Required: no · Default: empty string

Interpret above value as YAML format — config key: use_yaml

Nested data can be set using YAML format, for example mykey: "My value". When using this format, this option needs to be enabled. When using tokens and YAML altogether, make sure that tokens are wrapped as a string. Example: title: "[node:title]"

Type: checkbox · Required: no · Default: false

Validate YAML to prevent this from being executed when invalid — config key: validate_yaml

Type: checkbox · Required: no · Default: false

Target language — config key: target_langcode

Define the language that the given value should be translated to.
When using the "Defined by token" option, make sure there is a token with this name: eca_translate_target_langcode

Type: select · Required: yes · Default: _interface

Allowed values depend on the configuration of the target site.

Value format: A language code enabled on the target site. The special values _interface and _preferred resolve at runtime.