W3cubDocs

/Symfony 4.1

TranslationExtension

class TranslationExtension extends AbstractExtension

Provides integration of the Translation component with Twig.

Methods

__construct(TranslatorInterface $translator = null, NodeVisitorInterface $translationNodeVisitor = null)
getTranslator()
getFilters()

{@inheritdoc}

AbstractTokenParser[] getTokenParsers()

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

getNodeVisitors()

{@inheritdoc}

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

{@inheritdoc}

Details

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

Parameters

TranslatorInterface $translator
NodeVisitorInterface $translationNodeVisitor

getTranslator()

getFilters()

{@inheritdoc}

AbstractTokenParser[] getTokenParsers()

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

Return Value

AbstractTokenParser[]

getNodeVisitors()

{@inheritdoc}

getTranslationNodeVisitor()

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

Parameters

$message
array $arguments
$domain
$locale

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

Parameters

$message
$count
array $arguments
$domain
$locale

getName()

{@inheritdoc}

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Twig/Extension/TranslationExtension.html