HTMLPurifier_Language
Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.
- Full name:
\HTMLPurifier_Language
Properties
code
ISO 639 language code of language. Prefers shortest possible version.
fallback
Fallback language code.
messages
Array of localizable messages.
errorNames
Array of localizable error codes.
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.
_loaded
Has the language object been loaded yet?
config
context
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$config |
\HTMLPurifier_Config | |
$context |
\HTMLPurifier_Context |
load
Loads language object with necessary info from factory cache
getMessage
Retrieves a localised message.
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
string | string identifier of message |
Return Value:
localised message
getErrorName
Retrieves a localised error name.
Parameters:
Parameter | Type | Description |
---|---|---|
$int |
int | error number, corresponding to PHP's error reporting |
Return Value:
localised message
listify
Converts an array list into a string readable representation
Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array |
formatMessage
Formats a localised message with passed parameters
Parameters:
Parameter | Type | Description |
---|---|---|
$key |
string | string identifier of message |
$args |
array | Parameters to substitute in |
Return Value:
localised message
Automatically generated on 2025-03-18