Documentation

TranslationExtension extends AbstractExtension
in package

FinalYes

Provides integration of the Translation component with Twig.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Properties

$translationNodeVisitor  : mixed
$translator  : mixed

Methods

__construct()  : mixed
createTranslatable()  : TranslatableMessage
getFilters()  : array<string|int, TwigFilter>
Returns a list of filters to add to the existing list.
getFunctions()  : array<string|int, TwigFunction>
Returns a list of functions to add to the existing list.
getNodeVisitors()  : array<string|int, NodeVisitorInterface>
Returns the node visitor instances to add to the existing list.
getOperators()  : array<string|int, array<string|int, mixed>>
Returns a list of operators to add to the existing list.
getTests()  : array<string|int, TwigTest>
Returns a list of tests to add to the existing list.
getTokenParsers()  : array<string|int, TokenParserInterface>
Returns the token parser instances to add to the existing list.
getTranslationNodeVisitor()  : TranslationNodeVisitor
getTranslator()  : TranslatorInterface
trans()  : string

Properties

Methods

createTranslatable()

public createTranslatable(string $message[, array<string|int, mixed> $parameters = [] ][, string $domain = null ]) : TranslatableMessage
Parameters
$message : string
$parameters : array<string|int, mixed> = []
$domain : string = null
Return values
TranslatableMessage

getOperators()

Returns a list of operators to add to the existing list.

public getOperators() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>

First array of unary operators, second array of binary operators

trans()

public trans(string|Stringable|TranslatableInterface|null $message[, array<string|int, mixed>|string $arguments = [] ][, string $domain = null ][, string $locale = null ][, int $count = null ]) : string
Parameters
$message : string|Stringable|TranslatableInterface|null
$arguments : array<string|int, mixed>|string = []

Can be the locale as a string when $message is a TranslatableInterface

$domain : string = null
$locale : string = null
$count : int = null
Return values
string

        
On this page

Search results