PHP Class L10n, BicBucStriim

Afficher le fichier Open project: rvolz/BicBucStriim Class Usage Examples

Méthodes publiques

Свойство Type Description
$langa array Messages of primary localization language
$langb array Messages of fallback localization language
$user_lang string User language

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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() public méthode

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
Résultat string localized message string

offsetExists() public méthode

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

offsetGet() public méthode

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

Property Details

$langa public_oe property

Messages of primary localization language
public array $langa
Résultat array

$langb public_oe property

Messages of fallback localization language
public array $langb
Résultat array

$user_lang public_oe property

User language
public string $user_lang
Résultat string