83        $this->_loaded = 
true;
 
   93        if (!$this->_loaded) {
 
   96        if (!isset($this->messages[
$key])) {
 
   99        return $this->messages[
$key];
 
  109        if (!$this->_loaded) {
 
  112        if (!isset($this->errorNames[$int])) {
 
  113            return "[Error: $int]";
 
  115        return $this->errorNames[$int];
 
  126        $sep_last = $this->
getMessage(
'Item separator last');
 
  128        for (
$i = 0, $c = count($array); 
$i < $c; 
$i++) {
 
  130            } elseif (
$i + 1 < $c) {
 
  150        if (!$this->_loaded) {
 
  153        if (!isset($this->messages[
$key])) {
 
  156        $raw = $this->messages[
$key];
 
  159        foreach ($args as 
$i => $value) {
 
  160            if (is_object($value)) {
 
  164                        $generator = $this->context->get(
'Generator');
 
  166                    if (isset($value->name)) {
 
  167                        $subst[
'$'.$i.
'.Name'] = $value->name;
 
  169                    if (isset($value->data)) {
 
  170                        $subst[
'$'.$i.
'.Data'] = $value->data;
 
  172                    $subst[
'$'.$i.
'.Compact'] =
 
  173                    $subst[
'$'.$i.
'.Serialized'] = $generator->generateFromToken($value);
 
  177                    if (!empty($value->attr)) {
 
  178                        $stripped_token = clone $value;
 
  179                        $stripped_token->attr = array();
 
  180                        $subst[
'$'.$i.
'.Compact'] = $generator->generateFromToken($stripped_token);
 
  182                    $subst[
'$'.$i.
'.Line'] = $value->line ? $value->line : 
'unknown';
 
  185            } elseif (is_array($value)) {
 
  186                $keys = array_keys($value);
 
  189                    $subst[
'$'.$i] = $this->
listify($value);
 
  194                    $subst[
'$'.$i.
'.Values'] = $this->
listify(array_values($value));
 
  198            $subst[
'$' . 
$i] = $value;
 
  200        return strtr($raw, $subst);
 
An exception for terminatinating execution or to throw for unit testing.
static instance($prototype=null)
Retrieve sole instance of the factory.
Represents a language and defines localizable string formatting and other functions,...
$config
@type HTMLPurifier_Config
formatMessage($key, $args=array())
Formats a localised message with passed parameters.
$code
ISO 639 language code of language.
getErrorName($int)
Retrieves a localised error name.
getMessage($key)
Retrieves a localised message.
$_loaded
Has the language object been loaded yet? @type bool.
listify($array)
Converts an array list into a string readable representation.
$errorNames
Array of localizable error codes.
$error
True if no message file was found for this language, so English is being used instead.
$messages
Array of localizable messages.
$fallback
Fallback language code.
$context
@type HTMLPurifier_Context
load()
Loads language object with necessary info from factory cache.
__construct($config, $context)
Abstract base token class that all others inherit from.