Factory class for accessing message groups individually by id or all of them as an list. More...
Public Member Functions | |
getGroups () | |
Get all enabled non-dynamic message groups. | |
Static Public Member Functions | |
static | init () |
Initialises the list of groups (but not the groups itself if possible). | |
static | clearCache () |
Manually reset group cache. | |
static | getGroup ($id) |
Fetch a message group by id. | |
static | exists ($id) |
static | getAllGroups () |
Get all enabled message groups. | |
static | getPriority ($group) |
We want to de-emphasize time sensitive groups like news for 2009. | |
static | setPriority ($group, $priority= '') |
Sets the message group priority. | |
static | isDynamic (MessageGroup $group) |
static | getSharedGroups (MessageGroup $group) |
Returns a list of message groups that share (certain) messages with this group. | |
static | singleton () |
Constructor function. | |
static | getGroupsById (array $ids, $skipMeta=false) |
Get message groups for corresponding message group ids. | |
static | expandWildcards ($ids) |
If the list of message group ids contains wildcards, this function will match them against the list of all supported message groups and return matched message group ids. | |
static | getDynamicGroups () |
Contents on these groups changes on a whim. | |
static | getGroupsByType ($type) |
Get only groups of specific type (class). | |
static | collectGroupIds ($value, $key, $used) |
See getGroupStructure, just collects ids into array. | |
static | groupLabelSort ($a, $b) |
Sorts groups by label value. | |
static | subGroups (AggregateMessageGroup $parent) |
Like getGroupStructure but start from one root which must be an AggregateMessageGroup. | |
static | haveSingleSourceLanguage (array $groups) |
Checks whether all the message groups have the same source language. | |
static | isTranslatableMessage (MessageHandle $handle) |
Filters out messages that should not be translated under normal conditions. | |
Static Protected Member Functions | |
static | getCache () |
Returns a cacher object. | |
static | loadGroupDefinitions () |
This constructs the list of all groups from multiple different sources. | |
static | getAggregateGroups () |
Get all the aggregate messages groups defined in translate_metadata table. | |
Static Protected Attributes | |
static | $prioritycache = null |
static | $groups = null |
Private Member Functions | |
__construct () |
Factory class for accessing message groups individually by id or all of them as an list.
Definition at line 17 of file MessageGroups.php.
MessageGroups::__construct | ( | ) | [private] |
Definition at line 391 of file MessageGroups.php.
static MessageGroups::clearCache | ( | ) | [static] |
Manually reset group cache.
Use when automatic dependency tracking fails.
Definition at line 58 of file MessageGroups.php.
Referenced by TranslatablePage::addMarkedTag(), CreateMessageIndex::execute(), ApiAggregateGroups::execute(), SpecialPageTranslationMovePage::performAction(), SpecialPageTranslationDeletePage::performAction(), TranslationFuzzyUpdaterTest::setUp(), TranslateHooksTest::setUp(), SolrTTMServerTest::setUp(), PageTranslationTaggingText::setUp(), MessageGroupsTest::setUp(), MessageGroupStatesUpdaterJobTest::setUp(), MessageCollectionTest::setUp(), ApiTranslationReviewTest::setUp(), ApiQueryMessageGroupsTest::setUp(), MessageGroupsTest::testHaveSingleSourceLanguage(), SolrTTMServerTest::testSearchableTTMServer(), and PageTranslationTaggingText::testTranslationPageRestrictions().
static MessageGroups::collectGroupIds | ( | $ | value, | |
$ | key, | |||
$ | used | |||
) | [static] |
See getGroupStructure, just collects ids into array.
Definition at line 577 of file MessageGroups.php.
static MessageGroups::exists | ( | $ | id | ) | [static] |
string | $id |
Definition at line 200 of file MessageGroups.php.
Referenced by SpecialImportTranslations::execute().
static MessageGroups::expandWildcards | ( | $ | ids | ) | [static] |
If the list of message group ids contains wildcards, this function will match them against the list of all supported message groups and return matched message group ids.
string[]|string | $ids |
Definition at line 458 of file MessageGroups.php.
Referenced by AggregateMessageGroup::getGroups().
static MessageGroups::getAggregateGroups | ( | ) | [static, protected] |
Get all the aggregate messages groups defined in translate_metadata table.
Definition at line 661 of file MessageGroups.php.
Referenced by loadGroupDefinitions().
static MessageGroups::getAllGroups | ( | ) | [static] |
Get all enabled message groups.
Definition at line 208 of file MessageGroups.php.
Referenced by SpecialPageTranslationDeletePage::clearMetadata(), SpecialAggregateGroups::execute(), ApiAggregateGroups::getAllPages(), getGroupsByType(), TranslateUtils::groupSelector(), SpecialTranslate::groupSelector(), SpecialPageTranslationMovePage::moveMetadata(), and ApiQueryMessageGroupsTest::testAPIFilterAccuracy().
static MessageGroups::getCache | ( | ) | [static, protected] |
Returns a cacher object.
Definition at line 68 of file MessageGroups.php.
Referenced by clearCache().
static MessageGroups::getDynamicGroups | ( | ) | [static] |
Contents on these groups changes on a whim.
Definition at line 475 of file MessageGroups.php.
Referenced by getGroup(), and SpecialTranslate::groupSelector().
static MessageGroups::getGroup | ( | $ | id | ) | [static] |
Fetch a message group by id.
string | $id Message group id. |
Definition at line 170 of file MessageGroups.php.
Referenced by MessageGroupCache::__construct(), WikiWriter::__construct(), SpecialPageTranslation::classifyPages(), SpecialPageTranslation::execute(), ApiTranslationAids::execute(), ApiGroupReview::execute(), ApiAggregateGroups::execute(), exists(), MessageGroupStats::forGroup(), MessageGroupStats::forItem(), ApiTranslationStash::formatTranslation(), SpecialTranslationStats::getData(), ApiQueryMessageGroupStats::getData(), AggregateMessageGroup::getGroups(), getGroupsById(), MessageGroupStatesUpdaterJob::getGroupsWithTransitions(), AggregateMessageGroup::getMessage(), SandboxMessageGroup::getMessageContent(), RecentMessageGroup::getMessageContent(), TranslationHelpers::getMessageGroup(), TranslatablePage::getMessageGroup(), CoreMessageGroup::getUniqueDefinitions(), SpecialLanguageStats::getWorkflowStateCell(), TranslateUtils::groupSelector(), SpecialTranslate::groupSelector(), PoImporter::initMessages(), StatsTable::isBlacklisted(), SpecialMessageGroupStats::isValidValue(), CoreMessageGroup::load(), TranslationStatsBase::namespacesFromGroups(), SpecialManageGroups::processSubmit(), MessageGroupStatesUpdaterJob::run(), SpecialTranslate::setup(), SpecialManageGroups::showChanges(), MessageGroupStatesUpdaterJobTest::testGetNewState(), MessageGroupsTest::testGetParentGroups(), MessageGroupsTest::testHaveSingleSourceLanguage(), MessageGroupStatesUpdaterJobTest::testHooks(), and SpecialTranslate::tuxGroupSelector().
MessageGroups::getGroups | ( | ) |
Get all enabled non-dynamic message groups.
Definition at line 411 of file MessageGroups.php.
static MessageGroups::getGroupsById | ( | array $ | ids, | |
$ | skipMeta = false | |||
) | [static] |
Get message groups for corresponding message group ids.
string[] | $ids Group IDs | |
bool | $skipMeta Skip aggregate message groups |
Definition at line 431 of file MessageGroups.php.
Referenced by SpecialAggregateGroups::listSubgroups().
static MessageGroups::getGroupsByType | ( | $ | type | ) | [static] |
Get only groups of specific type (class).
string | $type Class name of wanted type |
Definition at line 489 of file MessageGroups.php.
static MessageGroups::getPriority | ( | $ | group | ) | [static] |
We want to de-emphasize time sensitive groups like news for 2009.
They can still exist in the system, but should not appear in front of translators looking to do some useful work.
MessageGroup|string | $group Message group ID |
Definition at line 221 of file MessageGroups.php.
Referenced by SpecialPageTranslation::classifyPages(), SpecialPageTranslation::execute(), ApiQueryMessageGroups::formatGroup(), AggregateMessageGroup::getGroups(), SpecialTranslate::groupSelector(), TranslateHooks::hideDiscouragedFromStats(), and SpecialAggregateGroups::listSubgroups().
static MessageGroups::getSharedGroups | ( | MessageGroup $ | group | ) | [static] |
Returns a list of message groups that share (certain) messages with this group.
MessageGroup | $group |
Definition at line 292 of file MessageGroups.php.
Referenced by SpecialPageTranslation::execute().
static MessageGroups::groupLabelSort | ( | $ | a, | |
$ | b | |||
) | [static] |
Sorts groups by label value.
Definition at line 582 of file MessageGroups.php.
static MessageGroups::haveSingleSourceLanguage | ( | array $ | groups | ) | [static] |
Checks whether all the message groups have the same source language.
array | $groups A list of message groups objects. |
Definition at line 639 of file MessageGroups.php.
Referenced by MessageGroupsTest::testHaveSingleSourceLanguage().
static MessageGroups::init | ( | ) | [static] |
Initialises the list of groups (but not the groups itself if possible).
Definition at line 26 of file MessageGroups.php.
Referenced by getGroup(), and getGroups().
static MessageGroups::isDynamic | ( | MessageGroup $ | group | ) | [static] |
Definition at line 279 of file MessageGroups.php.
Referenced by ApiGroupReview::execute(), MessageGroupStats::forItem(), ApiQueryMessageGroupStats::getData(), ApiQueryMessageGroups::getWorkflowStates(), SpecialTranslate::getWorkflowStatus(), SpecialMessageGroupStats::isValidValue(), ExportAsPoMessagesTask::output(), and SpecialTranslate::setup().
static MessageGroups::isTranslatableMessage | ( | MessageHandle $ | handle | ) | [static] |
Filters out messages that should not be translated under normal conditions.
MessageHandle | $handle Handle for the translation target. |
Definition at line 698 of file MessageGroups.php.
Referenced by SandboxMessageGroup::getDefinitions(), and RecentAdditionsMessageGroup::matchingMessage().
static MessageGroups::loadGroupDefinitions | ( | ) | [static, protected] |
This constructs the list of all groups from multiple different sources.
When possible, a cache dependency is created to automatically recreate the cache when configuration changes.
Definition at line 79 of file MessageGroups.php.
Referenced by init().
static MessageGroups::setPriority | ( | $ | group, | |
$ | priority = '' | |||
) | [static] |
Sets the message group priority.
MessageGroup|string | $group Message group | |
string | $priority Priority (empty string to unset) |
Definition at line 252 of file MessageGroups.php.
Referenced by SpecialPageTranslation::execute().
static MessageGroups::singleton | ( | ) | [static] |
Constructor function.
Definition at line 398 of file MessageGroups.php.
Referenced by MagicWordsCM::__construct(), SpecialPageAliasesCM::__construct(), MessageGroupStats::forEverything(), MessageGroupStats::forLanguageInternal(), getAllGroups(), TranslationStats::getPercentageTranslated(), and MagicExport::openHandles().
static MessageGroups::subGroups | ( | AggregateMessageGroup $ | parent | ) | [static] |
Like getGroupStructure but start from one root which must be an AggregateMessageGroup.
AggregateMessageGroup | $parent |
MWException |
Definition at line 598 of file MessageGroups.php.
MessageGroups::$groups = null [static, protected] |
Definition at line 23 of file MessageGroups.php.
Referenced by getAggregateGroups(), getGroupsById(), and getGroupsByType().
MessageGroups::$prioritycache = null [static, protected] |
Definition at line 21 of file MessageGroups.php.