This class implements some basic functions that wrap around the YAML message group configurations. More...
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 |
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.
Definition at line 20 of file MessageGroupBase.php.
MessageGroupBase::__construct | ( | ) | [protected] |
Definition at line 30 of file MessageGroupBase.php.
static MessageGroupBase::factory | ( | $ | conf | ) | [static] |
$conf |
Definition at line 38 of file MessageGroupBase.php.
Referenced by PremadeMediawikiExtensionGroups::createMessageGroup(), MessageGroups::getAggregateGroups(), MessageGroups::loadGroupDefinitions(), FileBasedMessageGroup::newFromMessageGroup(), MessageGroupBaseTest::setUp(), BlackListTest::setUp(), BlackListTest::testAllBlackList(), BlackListTest::testAllWhiteList(), MediaWikiExtensionFFSTest::testGenerateMessageBlock(), MessageGroupBaseTest::testGetNamespaceInvalid(), MessageGroupBaseTest::testGetNamespaceNumber(), MessageGroupBaseTest::testGetNamespaceString(), XliffFFSTest::testParsing(), BlackListTest::testSomeBlackList(), BlackListTest::testWhiteListOverrideBlackList(), and MediaWikiExtensionFFSTest::testWriteReal().
MessageGroupBase::getChecker | ( | ) |
Returns a message checker object or null.
Implements MessageGroup.
Definition at line 104 of file MessageGroupBase.php.
MessageGroupBase::getConfiguration | ( | ) |
Returns the parsed YAML configuration.
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().
MessageGroupBase::getDescription | ( | IContextSource $ | context = null |
) |
Returns a longer description about the group.
Description can use wikitext. Parameter $context was added in 2012-10-22.
IContextSource | $context Context can be used by subclasses to provide translated descriptions, for example. |
Implements MessageGroup.
Reimplemented in MediaWikiExtensionMessageGroup.
Definition at line 58 of file MessageGroupBase.php.
MessageGroupBase::getFFS | ( | ) |
Returns a FFS object that handles reading and writing messages to files.
May also return null if it doesn't make sense.
Implements MessageGroup.
Definition at line 90 of file MessageGroupBase.php.
Referenced by ProcessMessageChanges::addMessageUpdateChanges(), and FileBasedMessageGroup::exists().
MessageGroupBase::getFromConf | ( | $ | section, | |
$ | key | |||
) | [protected] |
Definition at line 86 of file MessageGroupBase.php.
Referenced by getChecker(), getDescription(), MediaWikiExtensionMessageGroup::getDescription(), getFFS(), getIcon(), getId(), getInsertablesSuggester(), getLabel(), getMangler(), FileBasedMessageGroup::getSourceFilePath(), getSourceLanguage(), MediaWikiMessageGroup::getTags(), FileBasedMessageGroup::getTargetFilename(), isMeta(), and parseNamespace().
MessageGroupBase::getIcon | ( | ) |
Returns an icon for this message group if any.
Implements MessageGroup.
Definition at line 62 of file MessageGroupBase.php.
MessageGroupBase::getId | ( | ) |
Returns the unique identifier for this group.
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().
MessageGroupBase::getInsertablesSuggester | ( | ) |
Returns the configured InsertablesSuggester if any.
Definition at line 157 of file MessageGroupBase.php.
MessageGroupBase::getKeys | ( | ) |
Optimized version of array_keys( $_->getDefinitions() ).
Reimplemented in MockFileBasedMessageGroup.
Definition at line 176 of file MessageGroupBase.php.
Referenced by parseTags().
MessageGroupBase::getLabel | ( | IContextSource $ | context = null |
) |
Returns the human readable label (as plain text).
Parameter $context was added in 2012-10-22.
IContextSource | $context Context can be used by subclasses to provide translated descriptions, for example. |
Implements MessageGroup.
Definition at line 54 of file MessageGroupBase.php.
MessageGroupBase::getMangler | ( | ) |
Return a message mangler or null.
Implements MessageGroup.
Reimplemented in AggregateMessageGroup.
Definition at line 129 of file MessageGroupBase.php.
MessageGroupBase::getMessage | ( | $ | key, | |
$ | code | |||
) |
Returns the definition or translation for given message key in given language code.
$key | string | |
$code | string |
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.
Implements MessageGroup.
Definition at line 347 of file MessageGroupBase.php.
MessageGroupBase::getNamespace | ( | ) |
Returns the namespace where messages are placed.
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.
Implements MessageGroup.
Definition at line 74 of file MessageGroupBase.php.
Referenced by ProcessMessageChanges::addMessageUpdateChanges(), getDefinitions(), MediaWikiExtensionMessageGroup::getDescription(), getKeys(), initCollection(), isSourceLanguage(), and ProcessMessageChanges::processMessageGroup().
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.
$type | string |
Implements MessageGroup.
Reimplemented in MediaWikiMessageGroup.
Definition at line 231 of file MessageGroupBase.php.
Referenced by setTags().
MessageGroupBase::getTranslatableLanguages | ( | ) |
Get all the translatable languages for a group, considering the whitelisting and blacklisting.
Implements MessageGroup.
Definition at line 358 of file MessageGroupBase.php.
MessageGroupBase::getTranslationAids | ( | ) |
List of available message types mapped to the classes implementing them.
Default implementation (all).
Implements MessageGroup.
Definition at line 403 of file MessageGroupBase.php.
MessageGroupBase::getWorkflowConfiguration | ( | ) |
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.
$code |
Implements MessageGroup.
Reimplemented in AggregateMessageGroup.
Definition at line 185 of file MessageGroupBase.php.
Referenced by ProcessMessageChanges::addMessageUpdateChanges().
MessageGroupBase::isMeta | ( | ) |
Implements MessageGroup.
Definition at line 70 of file MessageGroupBase.php.
MessageGroupBase::isSourceLanguage | ( | $ | code | ) | [protected] |
Definition at line 324 of file MessageGroupBase.php.
Referenced by FileBasedMessageGroup::getSourceFilePath().
MessageGroupBase::parseNamespace | ( | ) | [protected] |
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().
MessageGroupBase::setTags | ( | MessageCollection $ | collection | ) | [protected] |
Definition at line 296 of file MessageGroupBase.php.
Referenced by initCollection(), and AggregateMessageGroup::initCollection().
MessageGroupBase::$conf [protected] |
Definition at line 21 of file MessageGroupBase.php.
Referenced by factory(), getMessageGroupStates(), getSourceLanguage(), getWorkflowConfiguration(), and FileBasedMessageGroup::newFromMessageGroup().
MessageGroupBase::$groups [protected] |
Definition at line 23 of file MessageGroupBase.php.
Referenced by AggregateMessageGroup::getGroups(), and AggregateMessageGroup::loadMessagesFromCache().
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().