PHP Класс L10n, BicBucStriim

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$langa array Messages of primary localization language
$langb array Messages of fallback localization language
$user_lang string User language

Открытые методы

Метод Описание
__construct ( string $lang ) Find the user language, either one of the allowed languages or English as a fallback. Store the English messages as an alternative for incomplete translations.
message ( string $id ) : string Return a localized message string for $id.
offsetExists ( $id ) Implement this part of the Array interface for easier access by the templates.
offsetGet ( $id ) Implement this part of the Array interface for easier access by the templates.

Описание методов

__construct() публичный Метод

Find the user language, either one of the allowed languages or English as a fallback. Store the English messages as an alternative for incomplete translations.
public __construct ( string $lang )
$lang string user language (according to client)

message() публичный Метод

If there is no defined message for $id in the current language the function looks for an alterantive in English. If that also fails an error message is returned. If $id is NULL or '' the empty string will be returned.
public message ( string $id ) : string
$id string message id
Результат string localized message string

offsetExists() публичный Метод

Always return true, because then ::message will return an error string for undefined IDs.
public offsetExists ( $id )

offsetGet() публичный Метод

Just call ::message.
public offsetGet ( $id )

Описание свойств

$langa публичное свойство

Messages of primary localization language
public array $langa
Результат array

$langb публичное свойство

Messages of fallback localization language
public array $langb
Результат array

$user_lang публичное свойство

User language
public string $user_lang
Результат string