Documentation

Translator

Class Translator

Tags
mixin

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

$translators

private array<string|int, NativeArray> $translators = []

Methods

__call()

public __call(mixed $name, mixed $arguments) : mixed
Parameters
$name : mixed
$arguments : mixed
Tags
throws
Exception

__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>|null

getTranslator()

Returns a {@link \Phalcon\Translate\Adapter\NativeArray} for the specified language.

public getTranslator([null $lang = null ]) : NativeArray
Parameters
$lang : null = null
Return values
NativeArray

select()

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
$this

te()

public te(mixed $translateKey[, array<string|int, mixed> $opt = [] ]) : string
Parameters
$translateKey : mixed
$opt : array<string|int, mixed> = []
Return values
string

tte()

public tte(mixed $translateKey[, array<string|int, mixed> $opt = [] ]) : string
Parameters
$translateKey : mixed
$opt : array<string|int, mixed> = []
Return values
string

ttev()

public ttev(mixed $translateKey, mixed $value[, array<string|int, mixed> $opt = [] ]) : string
Parameters
$translateKey : mixed
$value : mixed
$opt : array<string|int, mixed> = []
Return values
string

xt()

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
Return values
string

        
On this page

Search results