Class for pointing to messages, like Title class is for titles. More...
Public Member Functions | |
__construct (Title $title) | |
isMessageNamespace () | |
Check if this handle is in a message namespace. | |
figureMessage () | |
Recommended to use getCode and getKey instead. | |
getKey () | |
Returns the identified or guessed message key. | |
getCode () | |
Returns the language code. | |
getEffectiveLanguageCode () | |
Return the code for the assumed language of the content, which might be different from the subpage code (qqq, no subpage). | |
isDoc () | |
Determine whether the current handle is for message documentation. | |
isPageTranslation () | |
Determine whether the current handle is for page translation feature. | |
getGroupIds () | |
Returns all message group ids this message belongs to. | |
getGroup () | |
Get the primary MessageGroup this message belongs to. | |
isValid () | |
Checks if the handle corresponds to a known message. | |
getTitle () | |
Get the original title. | |
isFuzzy () | |
Check if a title is marked as fuzzy. | |
Static Public Member Functions | |
static | hasFuzzyString ($text) |
Check if a string contains the fuzzy string. | |
Protected Attributes | |
$title = null | |
$key = null | |
$code = null | |
$groupIds = null | |
$group = false |
Class for pointing to messages, like Title class is for titles.
Definition at line 14 of file MessageHandle.php.
MessageHandle::__construct | ( | Title $ | title | ) |
Definition at line 26 of file MessageHandle.php.
MessageHandle::figureMessage | ( | ) |
Recommended to use getCode and getKey instead.
Definition at line 45 of file MessageHandle.php.
Referenced by getCode(), and getKey().
MessageHandle::getCode | ( | ) |
Returns the language code.
For language codeless source messages will return empty string.
Definition at line 80 of file MessageHandle.php.
Referenced by TranslateEditAddons::checkNeedsFuzzy(), MessageGroupStats::clear(), SolrTTMServer::createDocument(), TranslateEditAddons::figureNextPrevMessages(), getEffectiveLanguageCode(), isDoc(), MessageGroups::isTranslatableMessage(), MessageGroupStats::update(), SolrTTMServer::update(), and DatabaseTTMServer::update().
MessageHandle::getEffectiveLanguageCode | ( | ) |
Return the code for the assumed language of the content, which might be different from the subpage code (qqq, no subpage).
Definition at line 92 of file MessageHandle.php.
MessageHandle::getGroup | ( | ) |
Get the primary MessageGroup this message belongs to.
You should check first that the handle is valid.
MWException |
Definition at line 142 of file MessageHandle.php.
Referenced by TranslateEditAddons::checkNeedsFuzzy(), TranslateEditAddons::figureNextPrevMessages(), MessageGroups::isTranslatableMessage(), isValid(), SolrTTMServer::update(), DatabaseTTMServer::update(), and TranslateEditAddons::updateTransverTag().
MessageHandle::getGroupIds | ( | ) |
Returns all message group ids this message belongs to.
The primary message group id is always the first one. If the handle does not correspond to any message, the returned array is empty.
Reimplemented in MockMessageHandle.
Definition at line 128 of file MessageHandle.php.
Referenced by MessageGroupStats::clear(), SolrTTMServer::createDocument(), figureMessage(), getGroup(), MessageGroupStatesUpdaterJob::getGroupsWithTransitions(), isValid(), and MessageGroupStats::update().
MessageHandle::getKey | ( | ) |
Returns the identified or guessed message key.
Definition at line 69 of file MessageHandle.php.
Referenced by TranslateEditAddons::checkNeedsFuzzy(), SolrTTMServer::createDocument(), TranslateEditAddons::figureNextPrevMessages(), MessageIndex::getGroupIds(), SandboxMessageGroup::getMessageContent(), RecentMessageGroup::getMessageContent(), ApiQueryMessageTranslations::getTranslations(), MessageGroups::isTranslatableMessage(), SolrTTMServer::update(), DatabaseTTMServer::update(), and TranslateEditAddons::updateTransverTag().
MessageHandle::getTitle | ( | ) |
Get the original title.
Definition at line 184 of file MessageHandle.php.
Referenced by SolrTTMServer::createDocument(), figureMessage(), TranslateEditAddons::figureNextPrevMessages(), MessageIndex::getGroupIds(), ApiQueryMessageTranslations::getTranslations(), isMessageNamespace(), isPageTranslation(), TTMServerMessageUpdateJob::newJob(), MessageGroupStatesUpdaterJob::onChange(), SolrTTMServer::update(), DatabaseTTMServer::update(), and TranslateEditAddons::updateTransverTag().
static MessageHandle::hasFuzzyString | ( | $ | text | ) | [static] |
Check if a string contains the fuzzy string.
$text | string Arbitrary text |
Definition at line 194 of file MessageHandle.php.
Referenced by ApiQueryMessageTranslations::execute(), TranslationAid::getTranslations(), and SpecialTranslations::showTranslations().
MessageHandle::isDoc | ( | ) |
Determine whether the current handle is for message documentation.
Definition at line 106 of file MessageHandle.php.
Referenced by TranslateEditAddons::checkNeedsFuzzy(), and getEffectiveLanguageCode().
MessageHandle::isFuzzy | ( | ) |
Check if a title is marked as fuzzy.
Definition at line 202 of file MessageHandle.php.
MessageHandle::isMessageNamespace | ( | ) |
Check if this handle is in a message namespace.
Definition at line 34 of file MessageHandle.php.
Referenced by isValid().
MessageHandle::isPageTranslation | ( | ) |
Determine whether the current handle is for page translation feature.
This does not consider whether the handle corresponds to any message.
Definition at line 117 of file MessageHandle.php.
MessageHandle::isValid | ( | ) |
Checks if the handle corresponds to a known message.
Definition at line 156 of file MessageHandle.php.
Referenced by MessageGroups::isTranslatableMessage(), SolrTTMServer::update(), and DatabaseTTMServer::update().
MessageHandle::$code = null [protected] |
Definition at line 20 of file MessageHandle.php.
Referenced by getEffectiveLanguageCode().
MessageHandle::$group = false [protected] |
Definition at line 24 of file MessageHandle.php.
Referenced by isValid().
MessageHandle::$groupIds = null [protected] |
Definition at line 22 of file MessageHandle.php.
MessageHandle::$key = null [protected] |
Definition at line 18 of file MessageHandle.php.
MessageHandle::$title = null [protected] |
Definition at line 16 of file MessageHandle.php.
Referenced by figureMessage().