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 = array(), $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 = array(), $domain = null, $locale = null) deprecated

No description

getName()

{@inheritdoc}

Details

setLocale($locale)

{@inheritdoc}

Parameters

$locale

getLocale()

{@inheritdoc}

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

Parameters

$message
array $arguments
$domain
$locale
$count

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

Parameters

$translator
NodeVisitorInterface $translationNodeVisitor

getTranslator() deprecated

deprecated since Symfony 4.2

getFilters()

{@inheritdoc}

AbstractTokenParser[] getTokenParsers()

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

Return Value

AbstractTokenParser[]

getNodeVisitors()

{@inheritdoc}

getTranslationNodeVisitor()

transchoice($message, $count, array $arguments = array(), $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

getName()

{@inheritdoc}