PHP Класс Neos\Flow\I18n\EelHelper\TranslationHelper

Наследование: implements Neos\Eel\ProtectedContextAwareInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
allowsCallOfMethod ( string $methodName ) : boolean All methods are considered safe
id ( string $id ) : TranslationParameterToken Start collection of parameters for translation by id
translate ( string $id, string $originalLabel = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $locale = null ) : string Get the translated value for an id or original label
value ( string $value ) : TranslationParameterToken Start collection of parameters for translation by original label

Защищенные методы

Метод Описание
createTranslationParameterToken ( string $id = null, string $originalLabel = null ) : TranslationParameterToken Create and return a TranslationParameterToken.
translateByExplicitlyPassedOrderedArguments ( string $id, string $originalLabel = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $locale = null ) : string Get the translated value for an id or original label
translateByShortHandString ( string $shortHandString ) : string Translate by shorthand string

Описание методов

allowsCallOfMethod() публичный Метод

All methods are considered safe
public allowsCallOfMethod ( string $methodName ) : boolean
$methodName string
Результат boolean

createTranslationParameterToken() защищенный Метод

Create and return a TranslationParameterToken.
protected createTranslationParameterToken ( string $id = null, string $originalLabel = null ) : TranslationParameterToken
$id string
$originalLabel string
Результат TranslationParameterToken

id() публичный Метод

Start collection of parameters for translation by id
public id ( string $id ) : TranslationParameterToken
$id string Id to use for finding translation (trans-unit id in XLIFF)
Результат TranslationParameterToken

translate() публичный Метод

If only id is set and contains a translation shorthand string, translate according to that shorthand In all other cases: Replace all placeholders with corresponding values if they exist in the translated label.
public translate ( string $id, string $originalLabel = 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)
$originalLabel string The original translation value (the untranslated source string).
$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
$locale string An identifier of locale to use (NULL for use the default locale)
Результат string Translated label or source label / ID key

translateByExplicitlyPassedOrderedArguments() защищенный Метод

Replace all placeholders with corresponding values if they exist in the translated label.
protected translateByExplicitlyPassedOrderedArguments ( string $id, string $originalLabel = 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)
$originalLabel string The original translation value (the untranslated source string).
$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
$locale string An identifier of locale to use (NULL for use the default locale)
Результат string Translated label or source label / ID key

translateByShortHandString() защищенный Метод

Translate by shorthand string
protected translateByShortHandString ( string $shortHandString ) : string
$shortHandString string (PackageKey:Source:trans-unit-id)
Результат string Translated label or source label / ID key

value() публичный Метод

Start collection of parameters for translation by original label
public value ( string $value ) : TranslationParameterToken
$value string
Результат TranslationParameterToken