IdentityTranslator
in package
implements
TranslatorInterface, TranslatorInterface
Uses
TranslatorTrait
IdentityTranslator does not translate anything.
Tags
Interfaces, Classes, Traits and Enums
- TranslatorInterface
- TranslatorInterface.
- TranslatorInterface
Table of Contents
- $locale : mixed
- $selector : mixed
- __construct() : mixed
- getLocale() : mixed
- {@inheritdoc}
- setLocale() : mixed
- Sets the current locale.
- trans() : string
- Translates the given message.
- transChoice() : string
- Translates the given choice message by choosing a translation according to a number.
- getPluralizationRule() : int
Properties
$locale
private
mixed
$locale
$selector
private
mixed
$selector
Methods
__construct()
public
__construct([MessageSelector $selector = null ]) : mixed
Parameters
- $selector : MessageSelector = null
Return values
mixed —getLocale()
{@inheritdoc}
public
getLocale() : mixed
Return values
mixed —setLocale()
Sets the current locale.
public
setLocale(mixed $locale) : mixed
Parameters
- $locale : mixed
-
The locale
Return values
mixed —trans()
Translates the given message.
public
trans(mixed $id[, array<string|int, mixed> $parameters = [] ][, mixed $domain = null ][, mixed $locale = null ]) : string
Parameters
- $id : mixed
-
The message id (may also be an object that can be cast to string)
- $parameters : array<string|int, mixed> = []
-
An array of parameters for the message
- $domain : mixed = null
-
The domain for the message or null to use the default
- $locale : mixed = null
-
The locale or null to use the default
Return values
string —The translated string
transChoice()
Translates the given choice message by choosing a translation according to a number.
public
transChoice(mixed $id, mixed $number[, array<string|int, mixed> $parameters = [] ][, mixed $domain = null ][, mixed $locale = null ]) : string
Parameters
- $id : mixed
-
The message id (may also be an object that can be cast to string)
- $number : mixed
-
The number to use to find the index of the message
- $parameters : array<string|int, mixed> = []
-
An array of parameters for the message
- $domain : mixed = null
-
The domain for the message or null to use the default
- $locale : mixed = null
-
The locale or null to use the default
Tags
Return values
string —The translated string
getPluralizationRule()
private
getPluralizationRule(int $number, string $locale) : int
Parameters
- $number : int
- $locale : string