class TranslatorHelper extends Helper

Traits

A trait to help implement TranslatorInterface and LocaleAwareInterface.

Properties

protected $charset from Helper
protected $translator

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string
getCharset()

Gets the default charset.

from Helper
setLocale($locale)

{@inheritdoc}

getLocale()

{@inheritdoc}

trans($id, array $parameters = array(), $domain = 'messages', $locale = null)

No description

__construct(TranslatorInterface|null $translator = null)

No description

transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) deprecated

No description

string
getName()

Returns the canonical name of this helper.

Details

setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

string getCharset()

Gets the default charset.

Return Value

string The default charset

setLocale($locale)

{@inheritdoc}

Parameters

$locale

getLocale()

{@inheritdoc}

trans($id, array $parameters = array(), $domain = 'messages', $locale = null)

Parameters

$id
array $parameters
$domain
$locale

See also

__construct(TranslatorInterface|null $translator = null)

Parameters

TranslatorInterface|null $translator

transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) deprecated

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

Parameters

$id
$number
array $parameters
$domain
$locale

See also

string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name