Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.
Methods | ||||||
---|---|---|---|---|---|---|
public
|
__construct(HTMLPurifier_Config $config, HTMLPurifier_Context $context)
|
# | ||||
public
|
load()
Loads language object with necessary info from factory cache
Loads language object with necessary info from factory cache |
# | ||||
public
|
getMessage(string $key): string
Retrieves a localised message.
Retrieves a localised message. Parameters
Returnslocalised message |
# | ||||
public
|
getErrorName(int $int): string
Retrieves a localised error name.
Retrieves a localised error name. Parameters
Returnslocalised message |
# | ||||
public
|
listify(array $array): string
Converts an array list into a string readable representation
Converts an array list into a string readable representation |
# | ||||
public
|
formatMessage(string $key, array $args = []): string
Formats a localised message with passed parameters
Formats a localised message with passed parameters Parameters
Returnslocalised message |
# |
Properties | |||
---|---|---|---|
public
|
|
$code = 'en'
ISO 639 language code of language. Prefers shortest possible version.
ISO 639 language code of language. Prefers shortest possible version. |
# |
public
|
|
$fallback = false
Fallback language code.
Fallback language code. |
# |
public
|
|
$messages = []
Array of localizable messages.
Array of localizable messages. |
# |
public
|
|
$errorNames = []
Array of localizable error codes.
Array of localizable error codes. |
# |
public
|
|
$error = false
True if no message file was found for this language, so English
is being used instead. Check this if you'd like to…
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. |
# |
public
|
|
$_loaded = false
Has the language object been loaded yet?
Has the language object been loaded yet? |
# |
protected
|
|
$config
|
# |
protected
|
|
$context
|
# |