Package

ViewHelpers

ViewHelper Documentation

translate

Returns translated message using source message or key ID.

Also replaces all placeholders with formatted versions of provided values.

= Examples =

<f:translate id="user.unregistered">Unregistered User</f:translate> translation of label with the id "user.unregistered" and a fallback to "Unregistered User"

{f:translate(id: 'some.label.id', value: 'fallback result')} translation of label with the id "some.label.id" and a fallback to "fallback result"

<f:translate id="some.label.id" source="LabelsCatalog" locale="de_DE"/> translation from custom source "SomeLabelsCatalog" for locale "de_DE"

<f:translate id="some.label.id" source="LabelsCatalog" package="OtherPackage"/> translation from custom source "LabelsCatalog" in "OtherPackage"

<f:translate arguments="{0: 'foo', 1: '99.9'}"><![CDATA[Untranslated {0} and {1,number}]]></f:translate> translation of the label "Untranslated foo and 99.9"

<f:translate>Untranslated label</f:translate> translation of the label "Untranslated label"

Arguments

id string, required

Id to use for finding translation (trans-unit id in XLIFF)

value string, required

If $key is not specified or could not be resolved, this value is used. If this argument is not set, child nodes will be used to render the default

arguments anySimpleType, required

Numerically indexed array of values to be inserted into placeholders

source string, required

Name of file with translations (use / as a directory separator)

package string, required

Target package key. If not set, the current package key will be used

quantity anySimpleType, required

A number to find plural form for (float or int), NULL to not use plural forms

locale string, required

An identifier of locale to use (NULL for use the default locale)

ViewHelper Resources

Schema Resources