TranslatorTrait
A trait to help implement TranslatorInterface and LocaleAwareInterface.
Tags
Table of Contents
Properties
- $locale : string|null
Methods
- getLocale() : string
- {@inheritdoc}
- setLocale() : mixed
- {@inheritdoc}
- trans() : string
- {@inheritdoc}
- getPluralizationRule() : int
- Returns the plural position to use for the given locale and number.
Properties
$locale
private
string|null
$locale
= null
Methods
getLocale()
{@inheritdoc}
public
getLocale() : string
Return values
stringsetLocale()
{@inheritdoc}
public
setLocale(string $locale) : mixed
Parameters
- $locale : string
trans()
{@inheritdoc}
public
trans(string|null $id[, array<string|int, mixed> $parameters = [] ][, string $domain = null ][, string $locale = null ]) : string
Parameters
- $id : string|null
- $parameters : array<string|int, mixed> = []
- $domain : string = null
- $locale : string = null
Return values
stringgetPluralizationRule()
Returns the plural position to use for the given locale and number.
private
getPluralizationRule(float $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 : float
- $locale : string