Class HTMLPurifier_Language
Inheritance | HTMLPurifier_Language |
---|
Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_loaded | Has the language object been loaded yet? | HTMLPurifier_Language | |
$code | ISO 639 language code of language. Prefers shortest possible version. | HTMLPurifier_Language | |
$error | True if no message file was found for this language, so English is being used instead. Check this if you'd like to notify the user that they've used a non-supported language. | HTMLPurifier_Language | |
$errorNames | Array of localizable error codes. | HTMLPurifier_Language | |
$fallback | Fallback language code. | HTMLPurifier_Language | |
$messages | Array of localizable messages. | HTMLPurifier_Language |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$config | HTMLPurifier_Language | ||
$context | HTMLPurifier_Language |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | HTMLPurifier_Language | |
formatMessage() | Formats a localised message with passed parameters | HTMLPurifier_Language |
getErrorName() | Retrieves a localised error name. | HTMLPurifier_Language |
getMessage() | Retrieves a localised message. | HTMLPurifier_Language |
listify() | Converts an array list into a string readable representation | HTMLPurifier_Language |
load() | Loads language object with necessary info from factory cache | HTMLPurifier_Language |
Property Details
Method Details
public void __construct ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context |
Formats a localised message with passed parameters
public string formatMessage ( $key, $args = [] ) | ||
$key | string | String identifier of message |
$args | array | Parameters to substitute in |
return | string | Localised message |
---|
Retrieves a localised error name.
public string getErrorName ( $int ) | ||
$int | int | Error number, corresponding to PHP's error reporting |
return | string | Localised message |
---|
Retrieves a localised message.
public string getMessage ( $key ) | ||
$key | string | String identifier of message |
return | string | Localised message |
---|
Converts an array list into a string readable representation
public string listify ( $array ) | ||
$array | array |
Loads language object with necessary info from factory cache
public void load ( ) |