PHP Class Neos\Neos\ViewHelpers\Backend\TranslateViewHelper

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"
Inheritance: extends Neos\FluidAdaptor\ViewHelpers\TranslateViewHelper
Show file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$userService Neos\Neos\Service\UserService

Public Methods

Method Description
render ( string $id = null, string $value = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $languageIdentifier = null ) : string Renders the translated label.

Method Details

render() public method

Replaces all placeholders with corresponding values if they exist in the translated label.
public render ( string $id = null, string $value = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $languageIdentifier = null ) : string
$id string Id to use for finding translation (trans-unit id in XLIFF)
$value string 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 array Numerically indexed array of values to be inserted into placeholders
$source string Name of file with translations
$package string Target package key. If not set, the current package key will be used
$quantity mixed A number to find plural form for (float or int), NULL to not use plural forms
$languageIdentifier string An identifier of a language to use (NULL for using the default language)
return string Translated label or source label / ID key

Property Details

$userService protected property

protected UserService,Neos\Neos\Service $userService
return Neos\Neos\Service\UserService