class TranslateViewHelper extends TranslateViewHelper (View source)

Returns translated message using source message or key ID.

uses the selected backend language

  • Also replaces all placeholders with formatted versions of provided values.

= Examples =

{namespace neos=Neos\Neos\ViewHelpers}

Unregistered User ``` translation of label with the id "user.unregistered" and a fallback to "Unregistered User" {neos:backend.translate(id: 'some.label.id', value: 'fallback result')} ``` translation of label with the id "some.label.id" and a fallback to "fallback result" ``` translation from custom source "SomeLabelsCatalog" for locale "de_DE" ``` translation from custom source "LabelsCatalog" in "OtherPackage" ``` translation of the label "Untranslated foo and 99.9" Untranslated label ``` translation of the label "Untranslated label"

Properties

protected UserService $userService

Methods

string
render()

Renders the translated label.

Details

string render()

Renders the translated label.

Replaces all placeholders with corresponding values if they exist in the translated label.

Return Value

string

Translated label or source label / ID key

Exceptions

Exception