8.5.2.3 Substitutable text locale

The “qst” locale is used to provide consumer substitutions of the Text element in a single or in multiple languages. This locale extends the “mul” locale defined in 8.5.2.2 and therefore shall include a key “t” which provides the text that replacements are applied to.

The JSON object shall also contain a key “r” which consists of an array of replacement key and replacement text pairs. These replacements shall be applied by the consumer to the “t” text strings by replacing any occurrence of the replacement key with the replacement text.

If there is only one replacement text, and the text is encoded as a scalar the text isapplied to all languages.

If separate languages are provided the replacement texts shall be encoded as an array. In this case the first replacement text shall be applied to the first language, the second to the second language and so on. If there are less replacement texts than languages due to an error, no replacement takes place for the remaining languages, leaving the replacement key. The last example below illustrates these rules.

A replacement key shall be unique and shall not be a substring of another replacement key. A consumer shall ensure replaced text shall not be replaced again by any subsequent replacement operation.

An example of a single language substitution.

{

An example which provides 2 languages with a substitution that apply to both languages.

An example which provides 2 languages with a substitution that apply to both languages and substitutions that apply to specific languages.