PHP 클래스 Neos\FluidAdaptor\ViewHelpers\TranslateViewHelper

Also replaces all placeholders with formatted versions of provided values. = Examples = Unregistered User 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" 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"
상속: extends Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$translator Neos\Flow\I18n\Translator

공개 메소드들

메소드 설명
injectTranslator ( Translator $translator )
render ( string $id = null, string $value = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $locale = null ) : string Renders the translated label.

메소드 상세

injectTranslator() 공개 메소드

public injectTranslator ( Translator $translator )
$translator Neos\Flow\I18n\Translator

render() 공개 메소드

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 $locale = 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 (use / as a directory separator)
$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
$locale string An identifier of locale to use (NULL for use the default locale)
리턴 string Translated label or source label / ID key

프로퍼티 상세

$translator 보호되어 있는 프로퍼티

protected Translator,Neos\Flow\I18n $translator
리턴 Neos\Flow\I18n\Translator