Skip to main content

Translation Format

This page explains how a single translation is structured, what features it supports, and how it can be used.

Singular String

A singular string is the most basic form of a translation. It consists of a single string that is used as a translation for a specific key.

key: "This is a translation"

String with a Placeholder

A string with a placeholder is a translation that contains a placeholder that can be replaced with a dynamic value.

key: "This is a translation with following dynamic value: {0}"
key2: "This is a translation with two values: {0} and {1} or three? {2}"

Linking to another Translation

A translation can link to another translation. This is useful when you want to reuse a translation in multiple places.

Linking without placeholders

key: "{namespace:key/language}"

Dynamic Namespace

When no namespace is provided, the namespace of the current translation is used. This can be combined with the dynamic language.

key: "{key/language('Value1')}"

Dynamic Language

When no language is provided, the language of the current translation is used. This can be combined with the dynamic namespace.

key: "{namespace:key('Value1')}"

Linking with placeholders

It is also possible to link to another translation with placeholders. The round brackets are optional and can be omitted if no placeholders are used.

Placeholder are to be formatted as follows inside the brackets: 'First', 'Second', 'Third', ... Each placeholder is separated by a comma and a space and is enclosed in single quotes.

Examples:

key: "{namespace:key/language('Value1')}"
key2: "{namespace:key('Value1', 'Value2')}"
key3: "{key/language('Value1', 'Value2')}"
key4: "{key('Value1', 'Value2', 'Value3')}"