Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\NodeData\DataMwI18n Class Reference

data-mw-i18n information, used for internationalization. More...

+ Inheritance diagram for Wikimedia\Parsoid\NodeData\DataMwI18n:
+ Collaboration diagram for Wikimedia\Parsoid\NodeData\DataMwI18n:

Public Member Functions

 getSpanInfo ()
 Get the I18nInfo associated to a span (which will be used to fill in the span content) or null, if non-existent.
 
 getAttributeInfo (string $name)
 Get the I18nInfo that will be used to localize an element attribute value with the name $name or null, if non-existent.
 
 getAttributeNames ()
 Get the name of the localized attributes or an empty array if no localized attributes.
 
 setSpanInfo (I18nInfo $info)
 Defines the internationalization parameters of a string contained in a span.
 
 setAttributeInfo (string $name, I18nInfo $info)
 Defines the internationalization parameters of the $name attribute's value.
 
 __clone ()
 
 flatten ()
 Provide a flattened "plain string" form of this data for use as the value of a compatibility attribute to implement HTML semantics.
Returns
?string a plain string, or null to omit the compatibility attribute

 
 toJsonArray ()
 

Static Public Member Functions

static defaultValue ()
 Return a default value for an unset data-mw-i18n attribute.
 
static hint ()
 Provide a JsonCodec Hint for serializing objects of this type.
 
static newFromJsonArray (array $json)
 
static jsonClassHintFor (string $keyName)
 

Detailed Description

data-mw-i18n information, used for internationalization.

This data is used to represent the information necessary for later localization of messages (in spans) or element attributes values.

Member Function Documentation

◆ defaultValue()

static Wikimedia\Parsoid\NodeData\DataMwI18n::defaultValue ( )
static

Return a default value for an unset data-mw-i18n attribute.

Returns
DataMwI18n

Implements Wikimedia\Parsoid\Utils\RichCodecable.

◆ flatten()

Wikimedia\Parsoid\NodeData\DataMwI18n::flatten ( )

Provide a flattened "plain string" form of this data for use as the value of a compatibility attribute to implement HTML semantics.

Returns
?string a plain string, or null to omit the compatibility attribute

Implements Wikimedia\Parsoid\Utils\RichCodecable.

◆ getAttributeInfo()

Wikimedia\Parsoid\NodeData\DataMwI18n::getAttributeInfo ( string $name)

Get the I18nInfo that will be used to localize an element attribute value with the name $name or null, if non-existent.

Parameters
string$name
Returns
I18nInfo|null

◆ getAttributeNames()

Wikimedia\Parsoid\NodeData\DataMwI18n::getAttributeNames ( )

Get the name of the localized attributes or an empty array if no localized attributes.

Returns
array

◆ getSpanInfo()

Wikimedia\Parsoid\NodeData\DataMwI18n::getSpanInfo ( )

Get the I18nInfo associated to a span (which will be used to fill in the span content) or null, if non-existent.

Returns
I18nInfo|null

◆ hint()

static Wikimedia\Parsoid\NodeData\DataMwI18n::hint ( )
static

Provide a JsonCodec Hint for serializing objects of this type.

Returns
class-string|Hint|null

Implements Wikimedia\Parsoid\Utils\RichCodecable.


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