Texts with embedded dynamic values
Syntax
$res-key.fill($value1,..., $valueN)
Description
Dynamic values can be embedded in a multilingual text. The syntax for this is defined via the Java message format. If a multilingual text contains such placeholders ({0}
, {1}
,...), these can be assigned using the fill
function.
If not all parameters are occupied by the call of fill
, the result contains still open parameters, which can be occupied in a further call of fill
. This means that the two following expressions are equivalent:
$res-key.fill($value1, $value2).fill($value3, $value4)
$res-key.fill($value1, $value2, $value3, $value4)
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
res-key | Business object | A resource key with at least one parameter that can be filled dynamically. | yes | |
values | String | Dynamic values for the placeholders within the res-key . |
yes |
Return value
Type: String
A multilingual text with parameters inserted.
Examples
#("Die Antwort lautet {0}."@de, "{0} is the answer."@en).fill(42)
Output German: Die Antwort lautet 42.
Output English: 42 is the answer.