Translator
in package
Permite la traducción de cadenas de texto a diferentes idiomas. Con posibilidad de usar parámetros.
Table of Contents
- $defaultLang : mixed
- $lang : string
- $languages : array<string|int, mixed>
- $notFound : array<string|int, mixed>
- $translations : array<string|int, mixed>
- __construct() : mixed
- customTrans() : string
- deploy() : void
- getAvailableLanguages() : array<string|int, mixed>
- getLang() : string
- getMissingStrings() : array<string|int, mixed>
- getUsedStrings() : array<string|int, mixed>
- notFound() : array<string|int, mixed>
- reload() : void
- setDefaultLang() : void
- setLang() : void
- trans() : string
- getDefaultLang() : string
- getFolders() : array<string|int, mixed>
- getTransKey() : string
- load() : void
Properties
$defaultLang
private
static mixed
$defaultLang
= 'es_ES'
$lang
private
string
$lang
$languages
private
static array<string|int, mixed>
$languages
= []
$notFound
private
static array<string|int, mixed>
$notFound
= []
$translations
private
static array<string|int, mixed>
$translations
= []
Methods
__construct()
public
__construct([string|null $langCode = '' ]) : mixed
Parameters
- $langCode : string|null = ''
Return values
mixed —customTrans()
public
customTrans(string|null $langCode, string|null $txt[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $langCode : string|null
- $txt : string|null
- $parameters : array<string|int, mixed> = []
Return values
string —deploy()
public
static deploy() : void
Return values
void —getAvailableLanguages()
public
getAvailableLanguages() : array<string|int, mixed>
Return values
array<string|int, mixed> —getLang()
public
getLang() : string
Return values
string —getMissingStrings()
public
getMissingStrings() : array<string|int, mixed>
Return values
array<string|int, mixed> —getUsedStrings()
public
getUsedStrings() : array<string|int, mixed>
Return values
array<string|int, mixed> —notFound()
public
notFound() : array<string|int, mixed>
Return values
array<string|int, mixed> —reload()
public
static reload() : void
Return values
void —setDefaultLang()
public
static setDefaultLang(string|null $langCode) : void
Parameters
- $langCode : string|null
Return values
void —setLang()
public
setLang(string|null $langCode) : void
Parameters
- $langCode : string|null
Return values
void —trans()
public
trans(string|null $txt[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $txt : string|null
- $parameters : array<string|int, mixed> = []
Return values
string —getDefaultLang()
private
getDefaultLang() : string
Return values
string —getFolders()
private
getFolders() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTransKey()
private
getTransKey(string|null $txt) : string
Parameters
- $txt : string|null
Return values
string —load()
private
load(string $lang) : void
Parameters
- $lang : string