Translator
in package
Class Translator
Tags
Table of Contents
Properties
- $selected : mixed
- $terms : mixed
- $translators : array<string|int, NativeArray>
Methods
- __call() : mixed
- __construct() : mixed
- Translator constructor.
- getTermsByLang() : array<string|int, mixed>|null
- getTranslator() : NativeArray
- Returns a {@link \Phalcon\Translate\Adapter\NativeArray} for the specified language.
- select() : $this
- Changes the selected languages. This property impacts the whole object as it changes the used {@link \Phalcon\Translate\Adapter\NativeArray}.
- te() : string
- tte() : string
- ttev() : string
- xt() : string
- Returns the translation string of the given key for the specified language.
Properties
$selected
private
mixed
$selected
$terms
private
mixed
$terms
$translators
private
array<string|int, NativeArray>
$translators
= []
Methods
__call()
public
__call(mixed $name, mixed $arguments) : mixed
Parameters
- $name : mixed
- $arguments : mixed
Tags
__construct()
Translator constructor.
public
__construct(mixed $languages, mixed $selected) : mixed
Parameters
- $languages : mixed
- $selected : mixed
getTermsByLang()
public
getTermsByLang(string $lang) : array<string|int, mixed>|null
Parameters
- $lang : string
Return values
array<string|int, mixed>|nullgetTranslator()
Returns a {@link \Phalcon\Translate\Adapter\NativeArray} for the specified language.
public
getTranslator([null $lang = null ]) : NativeArray
Parameters
- $lang : null = null
Return values
NativeArrayselect()
Changes the selected languages. This property impacts the whole object as it changes the used {@link \Phalcon\Translate\Adapter\NativeArray}.
public
select(mixed $lang) : $this
Parameters
- $lang : mixed
Return values
$thiste()
public
te(mixed $translateKey[, array<string|int, mixed> $opt = [] ]) : string
Parameters
- $translateKey : mixed
- $opt : array<string|int, mixed> = []
Return values
stringtte()
public
tte(mixed $translateKey[, array<string|int, mixed> $opt = [] ]) : string
Parameters
- $translateKey : mixed
- $opt : array<string|int, mixed> = []
Return values
stringttev()
public
ttev(mixed $translateKey, mixed $value[, array<string|int, mixed> $opt = [] ]) : string
Parameters
- $translateKey : mixed
- $value : mixed
- $opt : array<string|int, mixed> = []
Return values
stringxt()
Returns the translation string of the given key for the specified language.
public
xt(string $lang, string $translateKey[, array<string|int, mixed> $placeholders = null ]) : string
Parameters
- $lang : string
- $translateKey : string
- $placeholders : array<string|int, mixed> = null