Class HTMLPurifier_Language

Description

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

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 5383)


	
			
Direct descendents
Class Description
HTMLPurifier_Language_en_x_test Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.
Variable Summary
mixed $code
mixed $config
mixed $context
mixed $error
mixed $errorNames
mixed $fallback
mixed $messages
mixed $_loaded
Method Summary
HTMLPurifier_Language __construct ( $config,  $context)
string formatMessage ($key $key, [$args $args = array()])
string getErrorName ($int $int)
string getMessage ($key $key)
void listify ( $array)
void load ()
Variables
mixed $code = 'en' (line 5389)

ISO 639 language code of language. Prefers shortest possible version

  • access: public
mixed $config (line 5422)

Instances of HTMLPurifier_Config and HTMLPurifier_Context

  • access: protected
mixed $context (line 5422)
  • access: protected
mixed $error = false (line 5411)

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.

  • access: public
mixed $errorNames = array() (line 5404)

Array of localizable error codes

  • access: public
mixed $fallback = false (line 5394)

Fallback language code

  • access: public
mixed $messages = array() (line 5399)

Array of localizable messages

  • access: public
mixed $_loaded = false (line 5417)

Has the language object been loaded yet?

  • todo: Make it private, fix usage in HTMLPurifier_LanguageTest
  • access: public
Methods
Constructor __construct (line 5424)
  • access: public
HTMLPurifier_Language __construct ( $config,  $context)
  • $config
  • $context
formatMessage (line 5493)

Formats a localised message with passed parameters

  • return: localised message
  • todo: Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available
  • access: public
string formatMessage ($key $key, [$args $args = array()])
  • $key $key: string identifier of message
  • $args $args: Parameters to substitute in
getErrorName (line 5460)

Retrieves a localised error name.

  • return: localised message
  • access: public
string getErrorName ($int $int)
  • $int $int: integer error number, corresponding to PHP's error reporting
getMessage (line 5448)

Retrieves a localised message.

  • return: localised message
  • access: public
string getMessage ($key $key)
  • $key $key: string identifier of message
listify (line 5469)

Converts an array list into a string readable representation

  • access: public
void listify ( $array)
  • $array
load (line 5433)

Loads language object with necessary info from factory cache

  • access: public
void load ()

Documentation generated on Sun, 06 Mar 2011 00:24:09 -0500 by phpDocumentor 1.4.3