\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.

Type

$fallback

$fallback : 

Fallback language code.

Type

$messages

$messages : 

Array of localizable messages.

Type

$errorNames

$errorNames : 

Array of localizable error codes.

Type

$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.

Type

$_loaded

$_loaded : 

Has the language object been loaded yet?

Type

$config

$config : 

Type

$context

$context : 

Type

Methods

load()

load() 

Loads language object with necessary info from factory cache

getMessage()

getMessage(string  $key) : string

Retrieves a localised message.

Parameters

string $key

string identifier of message

Returns

string —

localised message

getErrorName()

getErrorName(integer  $int) : string

Retrieves a localised error name.

Parameters

integer $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