Translator
in
Table of Contents
- getLocale() : string
- Get the default locale being used.
- setLocale() : void
- Set the default locale.
- trans() : mixed
- Get the translation for a given key.
- transChoice() : string
- Get a translation according to an integer value.
Methods
getLocale()
Get the default locale being used.
public
getLocale() : string
Return values
string —setLocale()
Set the default locale.
public
setLocale(string $locale) : void
Parameters
- $locale : string
Return values
void —trans()
Get the translation for a given key.
public
trans(string $key[, array<string|int, mixed> $replace = [] ][, string $locale = null ]) : mixed
Parameters
- $key : string
- $replace : array<string|int, mixed> = []
- $locale : string = null
Return values
mixed —transChoice()
Get a translation according to an integer value.
public
transChoice(string $key, int|array<string|int, mixed>|Countable $number[, array<string|int, mixed> $replace = [] ][, string $locale = null ]) : string
Parameters
- $key : string
- $number : int|array<string|int, mixed>|Countable
- $replace : array<string|int, mixed> = []
- $locale : string = null