MessageGroup Interface Reference
[Message group]

Interface for message groups. More...

Inheritance diagram for MessageGroup:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 getConfiguration ()
 Returns the parsed YAML configuration.
 getId ()
 Returns the unique identifier for this group.
 getLabel (IContextSource $context=null)
 Returns the human readable label (as plain text).
 getDescription (IContextSource $context=null)
 Returns a longer description about the group.
 getIcon ()
 Returns an icon for this message group if any.
 getNamespace ()
 Returns the namespace where messages are placed.
 isMeta ()
 exists ()
 If this function returns false, the message group is ignored and treated like it would not be configured at all.
 getFFS ()
 Returns a FFS object that handles reading and writing messages to files.
 getChecker ()
 Returns a message checker object or null.
 getMangler ()
 Return a message mangler or null.
 initCollection ($code)
 Initialises a message collection with the given language code, message definitions and message tags.
 load ($code)
 Returns a list of messages in a given language code.
 getDefinitions ()
 Shortcut for load( getSourceLanguage() ).
 getTags ($type=null)
 Returns message tags.
 getMessage ($key, $code)
 Returns the definition or translation for given message key in given language code.
 getSourceLanguage ()
 Returns language code depicting the language of source text.
 getMessageGroupStates ()
 Get the message group workflow state configuration.
 getTranslatableLanguages ()
 Get all the translatable languages for a group, considering the whitelisting and blacklisting.
 getTranslationAids ()
 List of available message types mapped to the classes implementing them.

Detailed Description

Interface for message groups.

Message groups are the heart of the Translate extension. They encapsulate a set of messages each. Aside from basic information like id, label and description, the class defines which mangler, message checker and file system support (FFS), if any, the group uses.

Definition at line 22 of file MessageGroup.php.


Member Function Documentation

MessageGroup::exists (  ) 

If this function returns false, the message group is ignored and treated like it would not be configured at all.

Useful for graceful degradation. Try to keep the check fast to avoid performance problems.

Returns:
bool

Implemented in AggregateMessageGroup, FileBasedMessageGroup, MessageGroupOld, and MockFileBasedMessageGroup.

MessageGroup::getChecker (  ) 

Returns a message checker object or null.

Todo:
Make an interface for message checkers.
Returns:
MessageChecker or null

Implemented in CoreMessageGroup, MessageGroupBase, MessageGroupOld, RecentMessageGroup, SandboxMessageGroup, and WikiPageMessageGroup.

MessageGroup::getConfiguration (  ) 

Returns the parsed YAML configuration.

Todo:
Remove from the interface. Only usage is in FFS. Figure out a better way.
Returns:
array

Implemented in MessageGroupBase, and MessageGroupOld.

MessageGroup::getDefinitions (  ) 
MessageGroup::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 $context Context can be used by subclasses to provide translated descriptions, for example.
Returns:
string

Implemented in MediaWikiExtensionMessageGroup, MessageGroupBase, MessageGroupOld, RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, WikiPageMessageGroup, and WorkflowStatesMessageGroup.

Referenced by StatsTable::getGroupDescription(), and SpecialTranslate::getGroupDescription().

MessageGroup::getFFS (  ) 

Returns a FFS object that handles reading and writing messages to files.

May also return null if it doesn't make sense.

Returns:
FFS or null

Implemented in MessageGroupBase, and MessageGroupOld.

MessageGroup::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

Implemented in CoreMessageGroup, MessageGroupBase, and MessageGroupOld.

Referenced by TranslateUtils::getIcon().

MessageGroup::getId (  ) 
MessageGroup::getLabel ( IContextSource $  context = null  ) 

Returns the human readable label (as plain text).

Parameter $context was added in 2012-10-22.

Parameters:
IContextSource $context Context can be used by subclasses to provide translated descriptions, for example.
Returns:
string

Implemented in MessageGroupBase, MessageGroupOld, RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.

Referenced by MessageTable::__construct(), ApiGroupReview::changeState(), and StatsTable::getGroupLabel().

MessageGroup::getMangler (  ) 

Return a message mangler or null.

Todo:
Make an interface for message manglers
Returns:
StringMatcher or null

Implemented in AggregateMessageGroup, MessageGroupBase, and MessageGroupOld.

MessageGroup::getMessage ( key,
code 
)

Returns the definition or translation for given message key in given language code.

Parameters:
$key string
$code string
Returns:
string|null

Implemented in AggregateMessageGroup, MessageGroupBase, MessageGroupOld, WikiMessageGroup, and WikiPageMessageGroup.

MessageGroup::getMessageGroupStates (  ) 

Get the message group workflow state configuration.

Returns:
MessageGroupStates

Implemented in MessageGroupBase, MessageGroupOld, MessageGroupWithoutTransitions, and MessageGroupWithTransitions.

Referenced by ApiQueryMessageGroups::getWorkflowStates().

MessageGroup::getNamespace (  ) 

Returns the namespace where messages are placed.

Returns:
int

Implemented in MessageGroupBase, and MessageGroupOld.

Referenced by MessageIndex::checkAndAdd(), SpecialManageGroups::formatChange(), and MessageGroups::getSharedGroups().

MessageGroup::getSourceLanguage (  ) 

Returns language code depicting the language of source text.

Returns:
string

Implemented in MessageGroupBase, MessageGroupOld, WikiMessageGroup, and WikiPageMessageGroup.

Referenced by TTMServerBootstrap::exportGroup(), and SpecialManageGroups::formatChange().

MessageGroup::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:
$type string
Returns:
array

Implemented in CoreMessageGroup, MediaWikiMessageGroup, MessageGroupBase, and MessageGroupOld.

MessageGroup::getTranslatableLanguages (  ) 

Get all the translatable languages for a group, considering the whitelisting and blacklisting.

Returns:
array|null The language codes as array keys.

Implemented in MessageGroupBase, and MessageGroupOld.

MessageGroup::getTranslationAids (  ) 

List of available message types mapped to the classes implementing them.

Returns:
array

Implemented in MessageGroupBase, and MessageGroupOld.

MessageGroup::initCollection ( code  ) 

Initialises a message collection with the given language code, message definitions and message tags.

Parameters:
$code 
Returns:
MessageCollection

Implemented in AggregateMessageGroup, and MessageGroupBase.

Referenced by TTMServerBootstrap::exportGroup(), and PageTranslationHooks::sourceExport().

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

Implemented in MessageGroupBase, and MessageGroupOld.

Referenced by StatsTable::getGroupLabel().

MessageGroup::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:
$code 
Returns:
array

Implemented in CoreMessageGroup, MessageGroupOld, WikiPageMessageGroup, and MockFileBasedMessageGroup.

Referenced by MessageGroupBase::getDefinitions().


The documentation for this interface was generated from the following file:
Generated on Tue Oct 29 00:00:48 2013 for MediaWiki Translate Extension by  doxygen 1.6.3