API - XOOPS 2.5.11 Beta 2
By monxoops.fr
HTMLPurifier_Language Class Reference

Public Member Functions

 __construct ($config, $context)
 
 load ()
 
 getMessage ($key)
 
 getErrorName ($int)
 
 listify ($array)
 
 formatMessage ($key, $args=array())
 

Data Fields

 $code = 'en'
 
 $fallback = false
 
 $messages = array()
 
 $errorNames = array()
 
 $error = false
 
 $_loaded = false
 

Protected Attributes

 $config
 
 $context
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

__construct (   $config,
  $context 
)
Parameters
HTMLPurifier_Config$config
HTMLPurifier_Context$context

Member Function Documentation

◆ formatMessage()

formatMessage (   $key,
  $args = array() 
)

Formats a localised message with passed parameters

Parameters
string$keystring identifier of message
array$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
Here is the call graph for this function:

◆ getErrorName()

getErrorName (   $int)

Retrieves a localised error name.

Parameters
int$interror number, corresponding to PHP's error reporting
Returns
string localised message
Here is the call graph for this function:

◆ getMessage()

getMessage (   $key)

Retrieves a localised message.

Parameters
string$keystring identifier of message
Returns
string localised message
Here is the call graph for this function:
Here is the caller graph for this function:

◆ listify()

listify (   $array)

Converts an array list into a string readable representation

Parameters
array$array
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

load ( )

Loads language object with necessary info from factory cache

Note
This is a lazy loader
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $_loaded

$_loaded = false

Has the language object been loaded yet? @type bool

Todo:
Make it private, fix usage in HTMLPurifier_LanguageTest

◆ $code

$code = 'en'

ISO 639 language code of language. Prefers shortest possible version. @type string

◆ $config

$config
protected

◆ $context

$context
protected

◆ $error

$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. @type bool

◆ $errorNames

$errorNames = array()

Array of localizable error codes. @type array

◆ $fallback

$fallback = false

Fallback language code. @type bool|string

◆ $messages

$messages = array()

Array of localizable messages. @type array


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