Interface for message groups. 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 () | |
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. |
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.
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.
Implemented in AggregateMessageGroup, FileBasedMessageGroup, MessageGroupOld, and MockFileBasedMessageGroup.
MessageGroup::getChecker | ( | ) |
Returns a message checker object or null.
Implemented in CoreMessageGroup, MessageGroupBase, MessageGroupOld, RecentMessageGroup, SandboxMessageGroup, and WikiPageMessageGroup.
MessageGroup::getConfiguration | ( | ) |
Returns the parsed YAML configuration.
Implemented in MessageGroupBase, and MessageGroupOld.
MessageGroup::getDefinitions | ( | ) |
Shortcut for load( getSourceLanguage() ).
Implemented in CoreMostUsedMessageGroup, MessageGroupBase, MessageGroupOld, RecentMessageGroup, SandboxMessageGroup, WikiMessageGroup, WikiPageMessageGroup, and MockWikiMessageGroup.
Referenced by MessageIndex::checkAndAdd(), and MessageGroups::getSharedGroups().
MessageGroup::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. |
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.
Implemented in MessageGroupBase, and MessageGroupOld.
MessageGroup::getIcon | ( | ) |
Returns an icon for this message group if any.
Implemented in CoreMessageGroup, MessageGroupBase, and MessageGroupOld.
Referenced by TranslateUtils::getIcon().
MessageGroup::getId | ( | ) |
Returns the unique identifier for this group.
Implemented in MessageGroupBase, MessageGroupOld, RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.
Referenced by MessageTable::__construct(), ProcessMessageChanges::addChange(), ApiGroupReview::changeState(), MessageIndex::checkAndAdd(), TTMServerBootstrap::exportGroup(), SpecialManageGroups::formatChange(), StatsTable::getGroupDescription(), MessageGroups::getSharedGroups(), ApiGroupReview::getState(), SpecialAggregateGroups::htmlIdForGroup(), MessageGroups::isDynamic(), StatsTable::makeGroupLink(), SpecialLanguageStats::makeGroupRow(), and ApiTranslateUser::trackGroup().
MessageGroup::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. |
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.
Implemented in AggregateMessageGroup, MessageGroupBase, and MessageGroupOld.
MessageGroup::getMessage | ( | $ | key, | |
$ | code | |||
) |
Returns the definition or translation for given message key in given language code.
$key | string | |
$code | string |
Implemented in AggregateMessageGroup, MessageGroupBase, MessageGroupOld, WikiMessageGroup, and WikiPageMessageGroup.
MessageGroup::getMessageGroupStates | ( | ) |
Get the message group workflow state configuration.
Implemented in MessageGroupBase, MessageGroupOld, MessageGroupWithoutTransitions, and MessageGroupWithTransitions.
Referenced by ApiQueryMessageGroups::getWorkflowStates().
MessageGroup::getNamespace | ( | ) |
Returns the namespace where messages are placed.
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.
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.
$type | string |
Implemented in CoreMessageGroup, MediaWikiMessageGroup, MessageGroupBase, and MessageGroupOld.
MessageGroup::getTranslatableLanguages | ( | ) |
Get all the translatable languages for a group, considering the whitelisting and blacklisting.
Implemented in MessageGroupBase, and MessageGroupOld.
MessageGroup::getTranslationAids | ( | ) |
List of available message types mapped to the classes implementing them.
Implemented in MessageGroupBase, and MessageGroupOld.
MessageGroup::initCollection | ( | $ | code | ) |
Initialises a message collection with the given language code, message definitions and message tags.
$code |
Implemented in AggregateMessageGroup, and MessageGroupBase.
Referenced by TTMServerBootstrap::exportGroup(), and PageTranslationHooks::sourceExport().
MessageGroup::isMeta | ( | ) |
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).
$code |
Implemented in CoreMessageGroup, MessageGroupOld, WikiPageMessageGroup, and MockFileBasedMessageGroup.
Referenced by MessageGroupBase::getDefinitions().