HumHub Documentation (unofficial)

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
type

bool

todo

Make it private, fix usage in HTMLPurifier_LanguageTest

$code

ISO 639 language code of language. Prefers shortest possible version.

public mixed $code = 'en'
Tags
type

string

$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
type

bool

$errorNames

Array of localizable error codes.

public mixed $errorNames = array()
Tags
type

array

$fallback

Fallback language code.

public mixed $fallback = \false
Tags
type

bool|string

$messages

Array of localizable messages.

public mixed $messages = array()
Tags
type

array

$config

protected mixed $config
Tags
type

HTMLPurifier_Config

$context

protected mixed $context
Tags
type

HTMLPurifier_Context

Methods

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
todo

Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available

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
string

load()

Loads language object with necessary info from factory cache

public load() : mixed
Tags
note

This is a lazy loader


        
On this page

Search results