class TranslationExtension extends AbstractExtension

Provides integration of the Translation component with Twig.

Traits

A trait to help implement TranslatorInterface and LocaleAwareInterface.

Methods

setLocale($locale)

{@inheritdoc}

getLocale()

{@inheritdoc}

trans($message, array $arguments = [], $domain = null, $locale = null, $count = null)

No description

__construct($translator = null, NodeVisitorInterface $translationNodeVisitor = null)

No description

getTranslator() deprecated

No description

getFilters()

{@inheritdoc}

AbstractTokenParser[]
getTokenParsers()

Returns the token parser instance to add to the existing list.

getNodeVisitors()

{@inheritdoc}

getTranslationNodeVisitor()

No description

transchoice($message, $count, array $arguments = [], $domain = null, $locale = null) deprecated

No description

getName()

{@inheritdoc}

Details

in TranslatorTrait at line 28
setLocale($locale)

{@inheritdoc}

Parameters

$locale

in TranslatorTrait at line 36
getLocale()

{@inheritdoc}

at line 112
trans($message, array $arguments = [], $domain = null, $locale = null, $count = null)

Parameters

$message
array $arguments
$domain
$locale
$count

at line 48
__construct($translator = null, NodeVisitorInterface $translationNodeVisitor = null)

Parameters

$translator
NodeVisitorInterface $translationNodeVisitor

at line 60
getTranslator() deprecated

deprecated since Symfony 4.2

at line 70
getFilters()

{@inheritdoc}

at line 83
AbstractTokenParser[] getTokenParsers()

Returns the token parser instance to add to the existing list.

Return Value

AbstractTokenParser[]

at line 102
getNodeVisitors()

{@inheritdoc}

at line 107
getTranslationNodeVisitor()

at line 127
transchoice($message, $count, array $arguments = [], $domain = null, $locale = null) deprecated

deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter

Parameters

$message
$count
array $arguments
$domain
$locale

at line 142
getName()

{@inheritdoc}