Class HTMLPurifier_Language

InheritanceHTMLPurifier_Language

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

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined 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

Hide inherited properties

PropertyTypeDescriptionDefined By
$config HTMLPurifier_Language
$context HTMLPurifier_Language

Public Methods

Hide inherited methods

MethodDescriptionDefined 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

$_loaded public property
public $_loaded false
$code public property
public $code 'en'
$config protected property
protected $config null
$context protected property
protected $context null
$error public property
public $error false
$errorNames public property
public $errorNames = []
$fallback public property
public $fallback false
$messages public property
public $messages = []

Method Details

__construct() public method

public void __construct ( $config, $context )
$config HTMLPurifier_Config
$context HTMLPurifier_Context
formatMessage() public method

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

getErrorName() public method

Retrieves a localised error name.

public string getErrorName ( $int )
$int int

Error number, corresponding to PHP's error reporting

return string

Localised message

getMessage() public method

Retrieves a localised message.

public string getMessage ( $key )
$key string

String identifier of message

return string

Localised message

listify() public method

Converts an array list into a string readable representation

public string listify ( $array )
$array array
load() public method

Loads language object with necessary info from factory cache

public void load ( )