PHP Class Neos\Flow\I18n\EelHelper\TranslationParameterToken

It also translates labels according to the configuration it stores
Inheritance: implements Neos\Eel\ProtectedContextAwareInterface
显示文件 Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$parameters array Key/Value store to keep the collected parameters
$translator Neos\Flow\I18n\Translator

Public Methods

Method Description
__construct ( string $id = null, string $value = null )
__toString ( ) Runs translate to avoid the need of calling translate as a finishing method
allowsCallOfMethod ( string $methodName ) : boolean All methods are considered safe
arguments ( array $arguments ) : TranslationParameterToken Set the arguments.
id ( string $id ) : TranslationParameterToken Set the id.
injectTranslator ( Translator $translator ) Inject the translator into the token.
locale ( string $locale ) : TranslationParameterToken Set the locale.
package ( string $package ) : TranslationParameterToken Set the package.
quantity ( mixed $quantity ) : TranslationParameterToken Set the quantity.
source ( string $source ) : TranslationParameterToken Set the source.
translate ( array $overrides = [] ) : string Translate according to currently collected parameters
value ( string $value ) : TranslationParameterToken Set the original translation value (the untranslated source string).

Method Details

__construct() public method

public __construct ( string $id = null, string $value = null )
$id string
$value string

__toString() public method

Runs translate to avoid the need of calling translate as a finishing method
public __toString ( )

allowsCallOfMethod() public method

All methods are considered safe
public allowsCallOfMethod ( string $methodName ) : boolean
$methodName string
return boolean

arguments() public method

Set the arguments.
public arguments ( array $arguments ) : TranslationParameterToken
$arguments array Numerically indexed array of values to be inserted into placeholders
return TranslationParameterToken

id() public method

Set the id.
public id ( string $id ) : TranslationParameterToken
$id string Id to use for finding translation (trans-unit id in XLIFF)
return TranslationParameterToken

injectTranslator() public method

Used for testing.
public injectTranslator ( Translator $translator )
$translator Neos\Flow\I18n\Translator

locale() public method

The locale Identifier will be converted into a Locale
public locale ( string $locale ) : TranslationParameterToken
$locale string An identifier of locale to use (NULL for use the default locale)
return TranslationParameterToken

package() public method

Set the package.
public package ( string $package ) : TranslationParameterToken
$package string Target package key. If not set, the current package key will be used
return TranslationParameterToken

quantity() public method

Set the quantity.
public quantity ( mixed $quantity ) : TranslationParameterToken
$quantity mixed A number to find plural form for (float or int), NULL to not use plural forms
return TranslationParameterToken

source() public method

Set the source.
public source ( string $source ) : TranslationParameterToken
$source string Name of file with translations
return TranslationParameterToken

translate() public method

Translate according to currently collected parameters
public translate ( array $overrides = [] ) : string
$overrides array An associative array to override the collected parameters
return string

value() public method

Set the original translation value (the untranslated source string).
public value ( string $value ) : TranslationParameterToken
$value string
return TranslationParameterToken

Property Details

$parameters protected_oe property

Key/Value store to keep the collected parameters
protected array $parameters
return array

$translator protected_oe property

protected Translator,Neos\Flow\I18n $translator
return Neos\Flow\I18n\Translator