Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
WikiPageMessageGroup Class Reference

Wraps the translatable page sections into a message group. More...

Inheritance diagram for WikiPageMessageGroup:
MessageGroupOld MessageGroup

Public Member Functions

 __construct ( $id, $title)
 
 getSourceLanguage ()
 @inheritDoc
 
 getTitle ()
 
 getDefinitions ()
 
 makeGroupKeys (array $keys)
 
 getLabel (?IContextSource $context=null)
 Overriding the getLabel method and deriving the label from the title.
 
 clearCaches ()
 Clear caches to avoid stale data.
 
 load ( $code)
 @inheritDoc
 
 getMessage ( $key, $code, $flags=IDBAccessObject::READ_LATEST)
 Returns of stored translation of message specified by the $key in language code $code.
 
 getValidator ()
 
 getInsertablesSuggester ()
 
 getDescription (?IContextSource $context=null)
 @inheritDoc
 
 getRelatedPage ()
 @inheritDoc
 
- Public Member Functions inherited from MessageGroupOld
 setLabel ( $value)
 
 getId ()
 
 setId ( $value)
 
 getNamespace ()
 Get the namespace where all the messages of this group belong.
 
 setNamespace ( $ns)
 Set the namespace where all the messages of this group belong.
 
 setDescription (string $value)
 
 getIcon ()
 @inheritDoc
 
 isMeta ()
 @inheritDoc
 
 getMangler ()
 
 getUniqueDefinitions ()
 This function can be used for meta message groups to list their "own" messages.
 
 getKeys ()
 @inheritDoc
 
 getMessage ( $key, $code)
 Returns of stored translation of message specified by the $key in language code $code.
 
 initCollection ( $code, $unique=false)
 Creates a new MessageCollection for this group.
 
 exists ()
 Can be overwritten to return false if something is wrong.
 
 getTags ( $type=null)
 @inheritDoc
 
 getMessageGroupStates ()
 Get the message group workflow state configuration.
 
 getTranslatableLanguages ()
 @inheritDoc
 
 getSupportConfig ()
 Gets support URL defined for the group if any.
 
- Public Member Functions inherited from MessageGroup
 initCollection ( $code)
 Initialises a message collection with the given language code, message definitions and message tags.
 

Protected Attributes

 $title
 
 $namespace = NS_TRANSLATIONS
 
 $definitions = null
 
- Protected Attributes inherited from MessageGroupOld
 $label = 'none'
 
 $id = 'none'
 
 $namespace = NS_MEDIAWIKI
 
 $description = null
 
 $meta = false
 
 $mangler = null
 
 $messages = []
 

Additional Inherited Members

- Static Public Member Functions inherited from MessageGroupOld
static normaliseKeys ( $array)
 
- Public Attributes inherited from MessageGroup
const DEFAULT_LANGUAGES = null
 Return value from getTranslatableLanguages when to use defaults.
 
- Protected Member Functions inherited from MessageGroupOld
 isSourceLanguage ( $code)
 
- Static Protected Member Functions inherited from MessageGroupOld
static addContext (Message $message, ?IContextSource $context=null)
 

Detailed Description

Wraps the translatable page sections into a message group.

Definition at line 29 of file WikiPageMessageGroup.php.

Constructor & Destructor Documentation

◆ __construct()

WikiPageMessageGroup::__construct ( $id,
$title )
Parameters
string$id
Title | string$title

Definition at line 39 of file WikiPageMessageGroup.php.

Member Function Documentation

◆ clearCaches()

WikiPageMessageGroup::clearCaches ( )

Clear caches to avoid stale data.

For example JobQueue can run for a longer time, and stale definitions would cause the total number of messages to be incorrect.

Since
2016.04

Definition at line 128 of file WikiPageMessageGroup.php.

◆ getDefinitions()

WikiPageMessageGroup::getDefinitions ( )
Returns
string[]

Reimplemented from MessageGroupOld.

Definition at line 65 of file WikiPageMessageGroup.php.

◆ getDescription()

WikiPageMessageGroup::getDescription ( ?IContextSource $context = null)

@inheritDoc

Reimplemented from MessageGroupOld.

Definition at line 198 of file WikiPageMessageGroup.php.

◆ getInsertablesSuggester()

WikiPageMessageGroup::getInsertablesSuggester ( )

Definition at line 193 of file WikiPageMessageGroup.php.

◆ getLabel()

WikiPageMessageGroup::getLabel ( ?IContextSource $context = null)

Overriding the getLabel method and deriving the label from the title.

Mainly to reduce the amount of data stored in the cache.

Parameters
IContextSource | null$context
Returns
string

Reimplemented from MessageGroupOld.

Definition at line 116 of file WikiPageMessageGroup.php.

◆ getMessage()

WikiPageMessageGroup::getMessage ( $key,
$code,
$flags = IDBAccessObject::READ_LATEST )

Returns of stored translation of message specified by the $key in language code $code.

Parameters
string$keyMessage key
string$codeLanguage code
int$flagsREAD_* class constant bitfield
Returns
string|null Stored translation or null.

Definition at line 150 of file WikiPageMessageGroup.php.

◆ getRelatedPage()

WikiPageMessageGroup::getRelatedPage ( )

@inheritDoc

Reimplemented from MessageGroupOld.

Definition at line 222 of file WikiPageMessageGroup.php.

◆ getSourceLanguage()

WikiPageMessageGroup::getSourceLanguage ( )

@inheritDoc

Reimplemented from MessageGroupOld.

Definition at line 45 of file WikiPageMessageGroup.php.

◆ getTitle()

WikiPageMessageGroup::getTitle ( )

Definition at line 49 of file WikiPageMessageGroup.php.

◆ getValidator()

WikiPageMessageGroup::getValidator ( )
Returns
ValidationRunner

Reimplemented from MessageGroupOld.

Definition at line 183 of file WikiPageMessageGroup.php.

◆ load()

WikiPageMessageGroup::load ( $code)

@inheritDoc

Reimplemented from MessageGroupOld.

Definition at line 133 of file WikiPageMessageGroup.php.

◆ makeGroupKeys()

WikiPageMessageGroup::makeGroupKeys ( array $keys)
Parameters
string[]$keys
Returns
string[]

Definition at line 102 of file WikiPageMessageGroup.php.

Member Data Documentation

◆ $definitions

WikiPageMessageGroup::$definitions = null
protected

Definition at line 62 of file WikiPageMessageGroup.php.

◆ $namespace

WikiPageMessageGroup::$namespace = NS_TRANSLATIONS
protected

Definition at line 33 of file WikiPageMessageGroup.php.

◆ $title

WikiPageMessageGroup::$title
protected

Definition at line 31 of file WikiPageMessageGroup.php.


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