\HTMLPurifier_Language

Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.

Summary

Methods
Properties
Constants
__construct()
load()
getMessage()
getErrorName()
listify()
formatMessage()
$code
$fallback
$messages
$errorNames
$error
$_loaded
No constants found
No protected methods found
$config
$context
N/A
No private methods found
No private properties found
N/A

Properties

$code

$code

ISO 639 language code of language. Prefers shortest possible version.

$fallback

$fallback

Fallback language code.

$messages

$messages

Array of localizable messages.

$errorNames

$errorNames

Array of localizable error codes.

$error

$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

$_loaded

Has the language object been loaded yet?

$config

$config

$context

$context

Methods

__construct()

__construct(\HTMLPurifier_Config  $config, \HTMLPurifier_Context  $context) : mixed

Parameters

\HTMLPurifier_Config $config
\HTMLPurifier_Context $context

Returns

mixed —

load()

load() : mixed

Loads language object with necessary info from factory cache

Returns

mixed —

getMessage()

getMessage(string  $key) : string

Retrieves a localised message.

Parameters

string $key

string identifier of message

Returns

string —

localised message

getErrorName()

getErrorName(int  $int) : string

Retrieves a localised error name.

Parameters

int $int

error number, corresponding to PHP's error reporting

Returns

string —

localised message

listify()

listify(array  $array) : string

Converts an array list into a string readable representation

Parameters

array $array

Returns

string —

formatMessage()

formatMessage(string  $key, array  $args = array()) : string

Formats a localised message with passed parameters

Parameters

string $key

string identifier of message

array $args

Parameters to substitute in

Returns

string —

localised message