HTMLPurifier 4.4.0
HTMLPurifier_Language Class Reference

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

Inheritance diagram for HTMLPurifier_Language:
HTMLPurifier_Language_en_x_test

List of all members.

Public Member Functions

 __construct ($config, $context)
 load ()
 Loads language object with necessary info from factory cache.
 getMessage ($key)
 Retrieves a localised message.
 getErrorName ($int)
 Retrieves a localised error name.
 listify ($array)
 Converts an array list into a string readable representation.
 formatMessage ($key, $args=array())
 Formats a localised message with passed parameters.
 __construct ($config, $context)
 load ()
 Loads language object with necessary info from factory cache.
 getMessage ($key)
 Retrieves a localised message.
 getErrorName ($int)
 Retrieves a localised error name.
 listify ($array)
 Converts an array list into a string readable representation.
 formatMessage ($key, $args=array())
 Formats a localised message with passed parameters.

Public Attributes

 $code = 'en'
 ISO 639 language code of language.
 $fallback = false
 Fallback language code.
 $messages = array()
 Array of localizable messages.
 $errorNames = array()
 Array of localizable error codes.
 $error = false
 True if no message file was found for this language, so English is being used instead.
 $_loaded = false
 Has the language object been loaded yet?
 $context

Protected Attributes

 $config
 Instances of HTMLPurifier_Config and HTMLPurifier_Context.

Detailed Description

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

Definition at line 7 of file Language.php.


Constructor & Destructor Documentation

HTMLPurifier_Language::__construct ( config,
context 
)

Definition at line 48 of file Language.php.

References $config, and $context.

HTMLPurifier_Language::__construct ( config,
context 
)

Definition at line 5762 of file HTMLPurifier.standalone.php.

References $config, and $context.


Member Function Documentation

HTMLPurifier_Language::formatMessage ( key,
args = array() 
)

Formats a localised message with passed parameters.

Parameters:
$keystring identifier of message
$argsParameters to substitute in
Returns:
string localised message
Todo:
Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available

Definition at line 117 of file Language.php.

References listify(), and load().

HTMLPurifier_Language::formatMessage ( key,
args = array() 
)

Formats a localised message with passed parameters.

Parameters:
$keystring identifier of message
$argsParameters to substitute in
Returns:
string localised message
Todo:
Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available

Definition at line 5831 of file HTMLPurifier.standalone.php.

References listify(), and load().

HTMLPurifier_Language::getErrorName ( int)

Retrieves a localised error name.

Parameters:
$intinteger error number, corresponding to PHP's error reporting
Returns:
string localised message

Definition at line 5798 of file HTMLPurifier.standalone.php.

References load().

HTMLPurifier_Language::getErrorName ( int)

Retrieves a localised error name.

Parameters:
$intinteger error number, corresponding to PHP's error reporting
Returns:
string localised message

Definition at line 84 of file Language.php.

References load().

HTMLPurifier_Language::getMessage ( key)

Retrieves a localised message.

Parameters:
$keystring identifier of message
Returns:
string localised message

Definition at line 5786 of file HTMLPurifier.standalone.php.

References load().

HTMLPurifier_Language::getMessage ( key)

Retrieves a localised message.

Parameters:
$keystring identifier of message
Returns:
string localised message

Definition at line 72 of file Language.php.

References load().

Referenced by listify().

HTMLPurifier_Language::listify ( array)

Converts an array list into a string readable representation.

Definition at line 5807 of file HTMLPurifier.standalone.php.

References getMessage().

HTMLPurifier_Language::listify ( array)

Converts an array list into a string readable representation.

Definition at line 93 of file Language.php.

References getMessage().

Referenced by formatMessage().

HTMLPurifier_Language::load ( )

Loads language object with necessary info from factory cache.

Note:
This is a lazy loader

Definition at line 5771 of file HTMLPurifier.standalone.php.

References HTMLPurifier_LanguageFactory::instance().

HTMLPurifier_Language::load ( )

Loads language object with necessary info from factory cache.

Note:
This is a lazy loader

Definition at line 57 of file Language.php.

References HTMLPurifier_LanguageFactory::instance().

Referenced by formatMessage(), getErrorName(), and getMessage().


Member Data Documentation

HTMLPurifier_Language::$_loaded = false

Has the language object been loaded yet?

Todo:
Make it private, fix usage in HTMLPurifier_LanguageTest
Todo:
Make it private, fix usage in HTMLPurifier_LanguageTest

Definition at line 41 of file Language.php.

HTMLPurifier_Language::$code = 'en'

ISO 639 language code of language.

Prefers shortest possible version

Definition at line 13 of file Language.php.

HTMLPurifier_Language::$config [protected]

Instances of HTMLPurifier_Config and HTMLPurifier_Context.

Definition at line 46 of file Language.php.

Referenced by __construct().

HTMLPurifier_Language::$context

Definition at line 46 of file Language.php.

Referenced by __construct().

HTMLPurifier_Language::$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 notify the user that they've used a non-supported language.

Definition at line 35 of file Language.php.

HTMLPurifier_Language::$errorNames = array()

Array of localizable error codes.

Definition at line 28 of file Language.php.

HTMLPurifier_Language::$fallback = false

Fallback language code.

Definition at line 18 of file Language.php.

HTMLPurifier_Language::$messages = array()

Array of localizable messages.

Definition at line 23 of file Language.php.


The documentation for this class was generated from the following files: