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

This is the interface and base implementation of unmanaged message groups. More...

Inheritance diagram for MessageGroupOld:
MessageGroup SubsetMessageGroup WikiMessageGroup WikiPageMessageGroup MessagePrefixMessageGroup RecentMessageGroup SandboxMessageGroup WorkflowStatesMessageGroup RecentAdditionsMessageGroup

Public Member Functions

 getLabel (?IContextSource $context=null)
 
 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.
 
 getDescription (?IContextSource $context=null)
 Returns a longer description about the group.
 
 setDescription ( $value)
 
 getIcon ()
 Returns an icon for this message group if any.
 
 isMeta ()
 
 getSourceLanguage ()
 Returns language code depicting the language of source text.
 
 getMangler ()
 
 load ( $code)
 Returns a list of messages in a given language code.
 
 getDefinitions ()
 This function returns array of type key => definition of all messages this message group handles.
 
 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.
 
 getValidator ()
 Returns a message validator object or null.
 
 getTags ( $type=null)
 Returns message tags.
 
 getMessageGroupStates ()
 Get the message group workflow state configuration.
 
 getTranslatableLanguages ()
 @inheritDoc
 
 getSupportConfig ()
 Gets support URL defined for the group if any.
 
 getRelatedPage ()
 @inheritDoc
 
- Public Member Functions inherited from MessageGroup
 initCollection ( $code)
 Initialises a message collection with the given language code, message definitions and message tags.
 

Static Public Member Functions

static normaliseKeys ( $array)
 

Protected Member Functions

 isSourceLanguage ( $code)
 

Static Protected Member Functions

static addContext (Message $message, ?IContextSource $context=null)
 

Protected Attributes

 $label = 'none'
 
 $id = 'none'
 
 $namespace = NS_MEDIAWIKI
 
 $description = null
 
 $meta = false
 
 $mangler = null
 
 $messages = []
 

Detailed Description

This is the interface and base implementation of unmanaged message groups.

Todo
Rename the class

Definition at line 29 of file MessageGroupOld.php.

Member Function Documentation

◆ addContext()

static MessageGroupOld::addContext ( Message $message,
?IContextSource $context = null )
staticprotected

Definition at line 278 of file MessageGroupOld.php.

◆ exists()

MessageGroupOld::exists ( )

Can be overwritten to return false if something is wrong.

Returns
bool

Implements MessageGroup.

Reimplemented in SubsetMessageGroup.

Definition at line 239 of file MessageGroupOld.php.

◆ getDefinitions()

MessageGroupOld::getDefinitions ( )

This function returns array of type key => definition of all messages this message group handles.

Returns
string[] List of message definitions indexed by key.

Implements MessageGroup.

Reimplemented in MessagePrefixMessageGroup, RecentMessageGroup, SandboxMessageGroup, SubsetMessageGroup, WikiMessageGroup, WikiPageMessageGroup, and WorkflowStatesMessageGroup.

Definition at line 149 of file MessageGroupOld.php.

◆ getDescription()

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

Returns a longer description about the group.

Description can use wikitext. Parameter $context was added in 2012-10-22.

Parameters
IContextSource | null$contextContext can be used by subclasses to provide translated descriptions, for example.
Returns
string

Implements MessageGroup.

Reimplemented in MessagePrefixMessageGroup, RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, WikiPageMessageGroup, and WorkflowStatesMessageGroup.

Definition at line 96 of file MessageGroupOld.php.

◆ getIcon()

MessageGroupOld::getIcon ( )

Returns an icon for this message group if any.

Returns
string|null File reference in one of the supported protocols:
Since
2012-12-04

Implements MessageGroup.

Reimplemented in SubsetMessageGroup.

Definition at line 104 of file MessageGroupOld.php.

◆ getId()

MessageGroupOld::getId ( )

◆ getKeys()

MessageGroupOld::getKeys ( )

@inheritDoc

Implements MessageGroup.

Reimplemented in SubsetMessageGroup.

Definition at line 169 of file MessageGroupOld.php.

◆ getLabel()

MessageGroupOld::getLabel ( ?IContextSource $context = null)
Parameters
IContextSource | null$context
Returns
string

Implements MessageGroup.

Reimplemented in MessagePrefixMessageGroup, RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, WikiPageMessageGroup, and WorkflowStatesMessageGroup.

Definition at line 40 of file MessageGroupOld.php.

◆ getMangler()

MessageGroupOld::getMangler ( )
Returns
StringMatcher

Implements MessageGroup.

Definition at line 131 of file MessageGroupOld.php.

◆ getMessage()

MessageGroupOld::getMessage ( $key,
$code )

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

Parameters
string$keyMessage key
string$codeLanguage code
Returns
mixed List of stored translation or \null.

Implements MessageGroup.

Reimplemented in SubsetMessageGroup, and WikiMessageGroup.

Definition at line 181 of file MessageGroupOld.php.

◆ getMessageGroupStates()

MessageGroupOld::getMessageGroupStates ( )

Get the message group workflow state configuration.

Returns
MessageGroupStates

Implements MessageGroup.

Definition at line 263 of file MessageGroupOld.php.

◆ getNamespace()

MessageGroupOld::getNamespace ( )

Get the namespace where all the messages of this group belong.

Returns
int

Implements MessageGroup.

Definition at line 77 of file MessageGroupOld.php.

◆ getRelatedPage()

MessageGroupOld::getRelatedPage ( )

@inheritDoc

Implements MessageGroup.

Reimplemented in WikiPageMessageGroup.

Definition at line 293 of file MessageGroupOld.php.

◆ getSourceLanguage()

MessageGroupOld::getSourceLanguage ( )

Returns language code depicting the language of source text.

Returns
string

Implements MessageGroup.

Reimplemented in WikiMessageGroup, and WikiPageMessageGroup.

Definition at line 119 of file MessageGroupOld.php.

◆ getSupportConfig()

MessageGroupOld::getSupportConfig ( )

Gets support URL defined for the group if any.

Returns
array|null

Implements MessageGroup.

Definition at line 288 of file MessageGroupOld.php.

◆ getTags()

MessageGroupOld::getTags ( $type = null)

Returns message tags.

If type is given, only message keys with that tag are returned. Otherwise an array[tag => keys] is returned.

Parameters
string | null$type
Returns
array

Implements MessageGroup.

Reimplemented in SubsetMessageGroup.

Definition at line 247 of file MessageGroupOld.php.

◆ getTranslatableLanguages()

MessageGroupOld::getTranslatableLanguages ( )

@inheritDoc

Implements MessageGroup.

Definition at line 274 of file MessageGroupOld.php.

◆ getUniqueDefinitions()

MessageGroupOld::getUniqueDefinitions ( )

This function can be used for meta message groups to list their "own" messages.

For example branched message groups can exclude the messages they share with each other.

Returns
array

Definition at line 164 of file MessageGroupOld.php.

◆ getValidator()

MessageGroupOld::getValidator ( )

Returns a message validator object or null.

Returns
ValidationRunner|null

Implements MessageGroup.

Reimplemented in MessagePrefixMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WikiPageMessageGroup.

Definition at line 243 of file MessageGroupOld.php.

◆ initCollection()

MessageGroupOld::initCollection ( $code,
$unique = false )

Creates a new MessageCollection for this group.

Parameters
string$codeLanguage code for this collection.
bool$uniqueWhether to build collection for messages unique to this group only.
Returns
MessageCollection

Definition at line 218 of file MessageGroupOld.php.

◆ isMeta()

MessageGroupOld::isMeta ( )
Todo
Unclear usage. Perhaps rename to isSecondary with the only purpose suppress warnings about message key conflicts.
Returns
bool

Implements MessageGroup.

Reimplemented in SubsetMessageGroup.

Definition at line 115 of file MessageGroupOld.php.

◆ isSourceLanguage()

MessageGroupOld::isSourceLanguage ( $code)
protected
Parameters
string$code
Returns
bool

Definition at line 255 of file MessageGroupOld.php.

◆ load()

MessageGroupOld::load ( $code)

Returns a list of messages in a given language code.

For some groups that list may be identical with the translation in the wiki. For other groups the messages may be loaded from a file (and differ from the current translations or definitions).

Parameters
string$code
Returns
string[]

Implements MessageGroup.

Reimplemented in SubsetMessageGroup, and WikiPageMessageGroup.

Definition at line 139 of file MessageGroupOld.php.

◆ normaliseKeys()

static MessageGroupOld::normaliseKeys ( $array)
static

Definition at line 190 of file MessageGroupOld.php.

◆ setDescription()

MessageGroupOld::setDescription ( $value)

Definition at line 100 of file MessageGroupOld.php.

◆ setId()

MessageGroupOld::setId ( $value)
Parameters
string$value

Definition at line 61 of file MessageGroupOld.php.

◆ setLabel()

MessageGroupOld::setLabel ( $value)
Parameters
string$value

Definition at line 45 of file MessageGroupOld.php.

◆ setNamespace()

MessageGroupOld::setNamespace ( $ns)

Set the namespace where all the messages of this group belong.

Parameters
int$ns

Definition at line 85 of file MessageGroupOld.php.

Member Data Documentation

◆ $description

MessageGroupOld::$description = null
protected

Definition at line 94 of file MessageGroupOld.php.

◆ $id

MessageGroupOld::$id = 'none'
protected

Definition at line 53 of file MessageGroupOld.php.

◆ $label

MessageGroupOld::$label = 'none'
protected

Definition at line 34 of file MessageGroupOld.php.

◆ $mangler

MessageGroupOld::$mangler = null
protected

Definition at line 128 of file MessageGroupOld.php.

◆ $messages

MessageGroupOld::$messages = []
protected

Definition at line 208 of file MessageGroupOld.php.

◆ $meta

MessageGroupOld::$meta = false
protected

Definition at line 113 of file MessageGroupOld.php.

◆ $namespace

MessageGroupOld::$namespace = NS_MEDIAWIKI
protected

Definition at line 71 of file MessageGroupOld.php.


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