pm_Locale
in package
Localization facilities
Tags
Table of Contents
- FALLBACK_LOCALE = 'en-US'
- getCode() : string
- Return current locale code
- getSection() : array<string|int, mixed>
- Get translated messages by key according to current locale
- keyExists() : bool
- Check if key exists in translations
- lmsg() : string
- Translate message by key according to current locale
- setCode() : mixed
- Set current locale code
- setTranslation() : void
- Set translation from array
Constants
FALLBACK_LOCALE
public
mixed
FALLBACK_LOCALE
= 'en-US'
Methods
getCode()
Return current locale code
public
static getCode() : string
Return values
string —getSection()
Get translated messages by key according to current locale
public
static getSection(string $sectionKey) : array<string|int, mixed>
Parameters
- $sectionKey : string
Tags
Return values
array<string|int, mixed> —keyExists()
Check if key exists in translations
public
static keyExists(string $key[, bool $findSection = false ]) : bool
Parameters
- $key : string
- $findSection : bool = false
Tags
Return values
bool —lmsg()
Translate message by key according to current locale
public
static lmsg(string $key[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $key : string
- $params : array<string|int, mixed> = []
Tags
Return values
string —setCode()
Set current locale code
public
static setCode(string $localeCode) : mixed
Parameters
- $localeCode : string
Tags
Return values
mixed —setTranslation()
Set translation from array
public
static setTranslation(string $localeCode, array<string|int, mixed> $messages) : void
Parameters
- $localeCode : string
- $messages : array<string|int, mixed>