TranslatorHelper
extends Helper
in package
Uses
TranslatorTrait
Tags
Table of Contents
- $translator : mixed
- $locale : mixed
- __construct() : mixed
- getLocale() : mixed
- {@inheritdoc}
- getName() : mixed
- {@inheritdoc}
- setLocale() : mixed
- {@inheritdoc}
- trans() : mixed
- transChoice() : mixed
- getPluralizationRule() : int
- Returns the plural position to use for the given locale and number.
Properties
$translator
protected
mixed
$translator
$locale
private
mixed
$locale
Methods
__construct()
public
__construct([TranslatorInterface|null $translator = null ]) : mixed
Parameters
- $translator : TranslatorInterface|null = null
Return values
mixed —getLocale()
{@inheritdoc}
public
getLocale() : mixed
Return values
mixed —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —setLocale()
{@inheritdoc}
public
setLocale(string $locale) : mixed
Parameters
- $locale : string
Return values
mixed —trans()
public
trans(mixed $id[, array<string|int, mixed> $parameters = [] ][, mixed $domain = 'messages' ][, mixed $locale = null ]) : mixed
Parameters
- $id : mixed
- $parameters : array<string|int, mixed> = []
- $domain : mixed = 'messages'
- $locale : mixed = null
Tags
Return values
mixed —transChoice()
public
transChoice(mixed $id, mixed $number[, array<string|int, mixed> $parameters = [] ][, mixed $domain = 'messages' ][, mixed $locale = null ]) : mixed
Parameters
- $id : mixed
- $number : mixed
- $parameters : array<string|int, mixed> = []
- $domain : mixed = 'messages'
- $locale : mixed = null
Tags
Return values
mixed —getPluralizationRule()
Returns the plural position to use for the given locale and number.
private
getPluralizationRule(int $number, string $locale) : int
The plural rules are derived from code of the Zend Framework (2010-09-25), which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
Parameters
- $number : int
- $locale : string