HTMLPurifier_Language
in package
Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.
Table of Contents
Properties
- $_loaded : mixed
- Has the language object been loaded yet?
- $code : mixed
- ISO 639 language code of language. Prefers shortest possible version.
- $error : mixed
- 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.
- $errorNames : mixed
- Array of localizable error codes.
- $fallback : mixed
- Fallback language code.
- $messages : mixed
- Array of localizable messages.
- $config : mixed
- $context : mixed
Methods
- __construct() : mixed
- formatMessage() : string
- Formats a localised message with passed parameters
- getErrorName() : string
- Retrieves a localised error name.
- getMessage() : string
- Retrieves a localised message.
- listify() : string
- Converts an array list into a string readable representation
- load() : mixed
- Loads language object with necessary info from factory cache
Properties
$_loaded
Has the language object been loaded yet?
public
mixed
$_loaded
= \false
Tags
$code
ISO 639 language code of language. Prefers shortest possible version.
public
mixed
$code
= 'en'
Tags
$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.
public
mixed
$error
= \false
Tags
$errorNames
Array of localizable error codes.
public
mixed
$errorNames
= array()
Tags
$fallback
Fallback language code.
public
mixed
$fallback
= \false
Tags
$messages
Array of localizable messages.
public
mixed
$messages
= array()
Tags
$config
protected
mixed
$config
Tags
$context
protected
mixed
$context
Tags
Methods
__construct()
public
__construct(HTMLPurifier_Config $config, HTMLPurifier_Context $context) : mixed
Parameters
- $config : HTMLPurifier_Config
- $context : HTMLPurifier_Context
formatMessage()
Formats a localised message with passed parameters
public
formatMessage(string $key[, array<string|int, mixed> $args = array() ]) : string
Parameters
- $key : string
-
string identifier of message
- $args : array<string|int, mixed> = array()
-
Parameters to substitute in
Tags
Return values
string —localised message
getErrorName()
Retrieves a localised error name.
public
getErrorName(int $int) : string
Parameters
- $int : int
-
error number, corresponding to PHP's error reporting
Return values
string —localised message
getMessage()
Retrieves a localised message.
public
getMessage(string $key) : string
Parameters
- $key : string
-
string identifier of message
Return values
string —localised message
listify()
Converts an array list into a string readable representation
public
listify(array<string|int, mixed> $array) : string
Parameters
- $array : array<string|int, mixed>
Return values
stringload()
Loads language object with necessary info from factory cache
public
load() : mixed