MessageGroupBase Class Reference
[Message group]

This class implements some basic functions that wrap around the YAML message group configurations. More...

Inheritance diagram for MessageGroupBase:
Inheritance graph
[legend]
Collaboration diagram for MessageGroupBase:
Collaboration 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 ()
 getSourceLanguage ()
 Returns language code depicting the language of source text.
 getDefinitions ()
 Shortcut for load( getSourceLanguage() ).
 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.
 getInsertablesSuggester ()
 Returns the configured InsertablesSuggester if any.
 getKeys ()
 Optimized version of array_keys( $_->getDefinitions() ).
 initCollection ($code)
 Initialises a message collection with the given language code, message definitions and message tags.
 getMessage ($key, $code)
 Returns the definition or translation for given message key in given language code.
 getTags ($type=null)
 Returns message tags.
 getWorkflowConfiguration ()
 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.

Static Public Member Functions

static factory ($conf)

Protected Member Functions

 __construct ()
 getFromConf ($section, $key)
 parseTags ($patterns)
 getRawTags ($type=null)
 setTags (MessageCollection $collection)
 parseNamespace ()
 isSourceLanguage ($code)

Protected Attributes

 $conf
 $namespace
 $groups
 $mangler

Detailed Description

This class implements some basic functions that wrap around the YAML message group configurations.

These message groups use the FFS classes and are managed with Special:ManageMessageGroups and processMessageChanges.php.

See also:
http://translatewiki.net/wiki/Translating:Group_configuration

Definition at line 20 of file MessageGroupBase.php.


Constructor & Destructor Documentation

MessageGroupBase::__construct (  )  [protected]

Definition at line 30 of file MessageGroupBase.php.


Member Function Documentation

static MessageGroupBase::factory ( conf  )  [static]
MessageGroupBase::getChecker (  ) 

Returns a message checker object or null.

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

Implements MessageGroup.

Definition at line 104 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getConfiguration (  ) 

Returns the parsed YAML configuration.

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

Implements MessageGroup.

Definition at line 46 of file MessageGroupBase.php.

Referenced by SimpleFFS::__construct(), and getTranslatableLanguages().

MessageGroupBase::getDefinitions (  ) 

Shortcut for load( getSourceLanguage() ).

Implements MessageGroup.

Definition at line 80 of file MessageGroupBase.php.

Referenced by getKeys(), and initCollection().

Here is the call graph for this function:

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

Implements MessageGroup.

Reimplemented in MediaWikiExtensionMessageGroup.

Definition at line 58 of file MessageGroupBase.php.

Here is the call graph for this function:

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

Implements MessageGroup.

Definition at line 90 of file MessageGroupBase.php.

Referenced by ProcessMessageChanges::addMessageUpdateChanges(), and FileBasedMessageGroup::exists().

Here is the call graph for this function:

MessageGroupBase::getFromConf ( section,
key 
) [protected]
MessageGroupBase::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.

Definition at line 62 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getId (  ) 

Returns the unique identifier for this group.

Returns:
string

Implements MessageGroup.

Definition at line 50 of file MessageGroupBase.php.

Referenced by AggregateMessageGroup::getGroups(), AggregateMessageGroup::getMessage(), SpecialAggregateGroups::listSubgroups(), MockFileBasedMessageGroup::load(), ProcessMessageChanges::processLanguage(), and MessageGroups::subGroups().

Here is the call graph for this function:

MessageGroupBase::getInsertablesSuggester (  ) 

Returns the configured InsertablesSuggester if any.

Since:
2013.09

Definition at line 157 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getKeys (  ) 

Optimized version of array_keys( $_->getDefinitions() ).

Returns:
array
Since:
2012-08-21

Reimplemented in MockFileBasedMessageGroup.

Definition at line 176 of file MessageGroupBase.php.

Referenced by parseTags().

Here is the call graph for this function:

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

Implements MessageGroup.

Definition at line 54 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getMangler (  ) 

Return a message mangler or null.

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

Todo:
Branch handling, merge with upper branch keys

Implements MessageGroup.

Reimplemented in AggregateMessageGroup.

Definition at line 129 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getMessage ( key,
code 
)

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

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

Implements MessageGroup.

Reimplemented in AggregateMessageGroup.

Definition at line 206 of file MessageGroupBase.php.

Referenced by MediaWikiExtensionMessageGroup::getDescription().

MessageGroupBase::getMessageGroupStates (  ) 

Get the message group workflow state configuration.

Returns:
MessageGroupStates

Implements MessageGroup.

Definition at line 347 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getNamespace (  ) 

Returns the namespace where messages are placed.

Returns:
int

Implements MessageGroup.

Definition at line 66 of file MessageGroupBase.php.

Referenced by AggregateMessageGroup::getMessage(), initCollection(), and AggregateMessageGroup::initCollection().

MessageGroupBase::getRawTags ( type = null  )  [protected]

Definition at line 279 of file MessageGroupBase.php.

Referenced by getTags().

MessageGroupBase::getSourceLanguage (  ) 

Returns language code depicting the language of source text.

Returns:
string

Implements MessageGroup.

Definition at line 74 of file MessageGroupBase.php.

Referenced by ProcessMessageChanges::addMessageUpdateChanges(), getDefinitions(), MediaWikiExtensionMessageGroup::getDescription(), getKeys(), initCollection(), isSourceLanguage(), and ProcessMessageChanges::processMessageGroup().

Here is the call graph for this function:

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

Implements MessageGroup.

Reimplemented in MediaWikiMessageGroup.

Definition at line 231 of file MessageGroupBase.php.

Referenced by setTags().

Here is the call graph for this function:

MessageGroupBase::getTranslatableLanguages (  ) 

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

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

Implements MessageGroup.

Definition at line 358 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getTranslationAids (  ) 

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

Default implementation (all).

Returns:
array

Implements MessageGroup.

Definition at line 403 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::getWorkflowConfiguration (  ) 
Deprecated:
Use getMessageGroupStates

Definition at line 331 of file MessageGroupBase.php.

Referenced by getMessageGroupStates().

MessageGroupBase::initCollection ( code  ) 

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

Parameters:
$code 
Returns:
MessageCollection

Implements MessageGroup.

Reimplemented in AggregateMessageGroup.

Definition at line 185 of file MessageGroupBase.php.

Referenced by ProcessMessageChanges::addMessageUpdateChanges().

Here is the call graph for this function:

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

Implements MessageGroup.

Definition at line 70 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::isSourceLanguage ( code  )  [protected]

Definition at line 324 of file MessageGroupBase.php.

Referenced by FileBasedMessageGroup::getSourceFilePath().

Here is the call graph for this function:

MessageGroupBase::parseNamespace (  )  [protected]

Definition at line 302 of file MessageGroupBase.php.

Here is the call graph for this function:

MessageGroupBase::parseTags ( patterns  )  [protected]

Collect exact keys, no point running them trough string matcher

Rest of the keys contain wildcards.

Use mangler to find messages that match.

Definition at line 245 of file MessageGroupBase.php.

Referenced by getTags().

Here is the call graph for this function:

MessageGroupBase::setTags ( MessageCollection collection  )  [protected]

Definition at line 296 of file MessageGroupBase.php.

Referenced by initCollection(), and AggregateMessageGroup::initCollection().

Here is the call graph for this function:


Member Data Documentation

MessageGroupBase::$conf [protected]
MessageGroupBase::$groups [protected]
MessageGroupBase::$mangler [protected]

Definition at line 28 of file MessageGroupBase.php.

Referenced by parseTags().

MessageGroupBase::$namespace [protected]

Definition at line 22 of file MessageGroupBase.php.

Referenced by initCollection(), and AggregateMessageGroup::initCollection().


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