Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\NodeData\I18nInfo Class Reference
+ Inheritance diagram for Wikimedia\Parsoid\NodeData\I18nInfo:
+ Collaboration diagram for Wikimedia\Parsoid\NodeData\I18nInfo:

Public Member Functions

 __construct (string $lang, string $key, ?array $params=null)
 
 __clone ()
 
 toJsonArray ()
 

Static Public Member Functions

static createInterfaceI18n (string $key, ?array $params)
 Creates internationalization information for a string or attribute value in the user interface language.
 
static createPageContentI18n (string $key, ?array $params)
 Creates internationalization information for a string or attribute value in the page content language.
 
static createLangI18n (Bcp47Code $lang, string $key, ?array $params)
 Creates internationalization information for a string or attribute value in an arbitrary language.
 
static newFromJsonArray (array $json)
 

Public Attributes

const USER_LANG = "x-user"
 
const PAGE_LANG = "x-page"
 
string $lang
 Value for the "lang" parameter.
 
string $key
 Key of the message in localization files.
 
array $params
 

Member Function Documentation

◆ createInterfaceI18n()

static Wikimedia\Parsoid\NodeData\I18nInfo::createInterfaceI18n ( string $key,
?array $params )
static

Creates internationalization information for a string or attribute value in the user interface language.

Parameters
string$key
array | null$params
Returns
I18nInfo

◆ createLangI18n()

static Wikimedia\Parsoid\NodeData\I18nInfo::createLangI18n ( Bcp47Code $lang,
string $key,
?array $params )
static

Creates internationalization information for a string or attribute value in an arbitrary language.

The use of this method is discouraged; use ::createPageContentI18n(...) and ::createInterfaceI18n(...) where possible rather than, respectively, ::createLangI18n($wgContLang, ...) and ::createLangI18n($wgLang, ...).

Parameters
Bcp47Code$lang
string$key
array | null$params
Returns
I18nInfo

◆ createPageContentI18n()

static Wikimedia\Parsoid\NodeData\I18nInfo::createPageContentI18n ( string $key,
?array $params )
static

Creates internationalization information for a string or attribute value in the page content language.

Parameters
string$key
array | null$params
Returns
I18nInfo

Member Data Documentation

◆ $lang

string Wikimedia\Parsoid\NodeData\I18nInfo::$lang

Value for the "lang" parameter.

Can be one of USER_LANG or PAGE_LANG, or a fixed language code (discouraged when USER_LANG or PAGE_LANG could be used instead).


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