This is the interface and base implementation of unmanaged message groups. More...
Public Member Functions | |
getLabel (IContextSource $context=null) | |
setLabel ($value) | |
getId () | |
setId ($value) | |
getNamespace () | |
Get the namespace where all the messages of this group belong. | |
setNamespace ($ns) | |
Set the namespace where all the messages of this group belong. | |
getOptional () | |
setOptional ($value) | |
getIgnored () | |
setIgnored ($value) | |
getDescription (IContextSource $context=null) | |
Returns a longer description about the group. | |
setDescription ($value) | |
getIcon () | |
Returns an icon for this message group if any. | |
isMeta () | |
setMeta ($value) | |
getSourceLanguage () | |
Returns language code depicting the language of source text. | |
getMangler () | |
setMangler ($value) | |
getReader ($code) | |
getWriter () | |
load ($code) | |
Returns a list of messages in a given language code. | |
getDefinitions () | |
This function returns array of type key => definition of all messages this message group handles. | |
getUniqueDefinitions () | |
This function can be used for meta message groups to list their "own" messages. | |
getMessage ($key, $code) | |
Returns of stored translation of message specified by the $key in language code $code. | |
getMessageFile ($code) | |
Returns path to the file where translation of language code $code are. | |
getPath () | |
getMessageFileWithPath ($code) | |
getSourceFilePath ($code) | |
initCollection ($code, $unique=false) | |
Creates a new MessageCollection for this group. | |
__construct () | |
exists () | |
Can be overwritten to retun false if something is wrong. | |
getChecker () | |
Returns a message checker object or null. | |
getTags ($type=null) | |
Returns message tags. | |
setConfiguration ($conf) | |
getConfiguration () | |
Returns the parsed YAML configuration. | |
getFFS () | |
Returns a FFS object that handles reading and writing messages to files. | |
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 | normaliseKeys ($array) |
Protected Member Functions | |
isSourceLanguage ($code) | |
Static Protected Member Functions | |
static | addContext (Message $message, IContextSource $context=null) |
Protected Attributes | |
$label = 'none' | |
Human-readable name of this group. | |
$id = 'none' | |
Group-wide unique id of this group. | |
$namespace = NS_MEDIAWIKI | |
The namespace where all the messages of this group belong. | |
$optional = array() | |
List of messages that are hidden by default, but can still be translated if needed. | |
$ignored = array() | |
List of messages that are always hidden and cannot be translated. | |
$description = null | |
Holds descripton of this group. | |
$meta = false | |
Meta groups consist of multiple groups or parts of other groups. | |
$mangler = null | |
To avoid key conflicts between groups or separated changed messages between branches one can set a message key mangler. | |
Private Attributes | |
$messages = array() | |
All the messages for this group, by language code. |
This is the interface and base implementation of unmanaged message groups.
Definition at line 20 of file MessageGroupOld.php.
MessageGroupOld::__construct | ( | ) |
Reimplemented in CoreMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.
Definition at line 315 of file MessageGroupOld.php.
Referenced by MockWikiMessageGroup::__construct(), and WikiMessageGroup::__construct().
static MessageGroupOld::addContext | ( | Message $ | message, | |
IContextSource $ | context = null | |||
) | [static, protected] |
Definition at line 396 of file MessageGroupOld.php.
Referenced by WorkflowStatesMessageGroup::getDescription(), WikiPageMessageGroup::getDescription(), RecentMessageGroup::getDescription(), RecentAdditionsMessageGroup::getDescription(), WorkflowStatesMessageGroup::getLabel(), RecentMessageGroup::getLabel(), and RecentAdditionsMessageGroup::getLabel().
MessageGroupOld::exists | ( | ) |
Can be overwritten to retun false if something is wrong.
Implements MessageGroup.
Definition at line 322 of file MessageGroupOld.php.
MessageGroupOld::getChecker | ( | ) |
Returns a message checker object or null.
Implements MessageGroup.
Reimplemented in CoreMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WikiPageMessageGroup.
Definition at line 326 of file MessageGroupOld.php.
MessageGroupOld::getConfiguration | ( | ) |
Returns the parsed YAML configuration.
Implements MessageGroup.
Definition at line 355 of file MessageGroupOld.php.
MessageGroupOld::getDefinitions | ( | ) |
This function returns array of type key => definition of all messages this message group handles.
MWException |
Implements MessageGroup.
Reimplemented in CoreMostUsedMessageGroup, RecentMessageGroup, SandboxMessageGroup, WikiMessageGroup, WikiPageMessageGroup, and MockWikiMessageGroup.
Definition at line 202 of file MessageGroupOld.php.
Referenced by getUniqueDefinitions(), CoreMessageGroup::getUniqueDefinitions(), and initCollection().
MessageGroupOld::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 RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, WikiPageMessageGroup, and WorkflowStatesMessageGroup.
Definition at line 122 of file MessageGroupOld.php.
MessageGroupOld::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 358 of file MessageGroupOld.php.
MessageGroupOld::getIcon | ( | ) |
Returns an icon for this message group if any.
Implements MessageGroup.
Reimplemented in CoreMessageGroup.
Definition at line 130 of file MessageGroupOld.php.
MessageGroupOld::getId | ( | ) |
Implements MessageGroup.
Reimplemented in RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.
Definition at line 49 of file MessageGroupOld.php.
MessageGroupOld::getIgnored | ( | ) |
Definition at line 105 of file MessageGroupOld.php.
MessageGroupOld::getLabel | ( | IContextSource $ | context = null |
) |
IContextSource | $context |
Implements MessageGroup.
Reimplemented in RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.
Definition at line 30 of file MessageGroupOld.php.
Referenced by getDefinitions().
MessageGroupOld::getMangler | ( | ) |
Implements MessageGroup.
Definition at line 161 of file MessageGroupOld.php.
Referenced by CoreMessageGroup::getTags(), and CoreMessageGroup::load().
MessageGroupOld::getMessage | ( | $ | key, | |
$ | code | |||
) |
Returns of stored translation of message specified by the $key in language code $code.
$key | String Key of the message. | |
$code | String Language code. |
Implements MessageGroup.
Reimplemented in WikiMessageGroup, and WikiPageMessageGroup.
Definition at line 229 of file MessageGroupOld.php.
MessageGroupOld::getMessageFile | ( | $ | code | ) |
Returns path to the file where translation of language code $code are.
string | $code |
Reimplemented in CoreMessageGroup.
Definition at line 263 of file MessageGroupOld.php.
Referenced by getMessageFileWithPath().
MessageGroupOld::getMessageFileWithPath | ( | $ | code | ) |
$code |
Definition at line 275 of file MessageGroupOld.php.
Referenced by CoreMessageGroup::getReader(), getSourceFilePath(), and CoreMessageGroup::load().
MessageGroupOld::getMessageGroupStates | ( | ) |
Get the message group workflow state configuration.
Implements MessageGroup.
Reimplemented in MessageGroupWithoutTransitions, and MessageGroupWithTransitions.
Definition at line 381 of file MessageGroupOld.php.
MessageGroupOld::getNamespace | ( | ) |
Get the namespace where all the messages of this group belong.
Implements MessageGroup.
Definition at line 68 of file MessageGroupOld.php.
Referenced by WikiPageMessageGroup::getMessage(), and initCollection().
MessageGroupOld::getOptional | ( | ) |
Definition at line 86 of file MessageGroupOld.php.
MessageGroupOld::getPath | ( | ) |
Reimplemented in CoreMessageGroup.
Definition at line 267 of file MessageGroupOld.php.
Referenced by getMessageFileWithPath().
MessageGroupOld::getReader | ( | $ | code | ) |
Reimplemented in CoreMessageGroup.
Definition at line 173 of file MessageGroupOld.php.
Referenced by load().
MessageGroupOld::getSourceFilePath | ( | $ | code | ) |
MessageGroupOld::getSourceLanguage | ( | ) |
Returns language code depicting the language of source text.
Implements MessageGroup.
Reimplemented in WikiMessageGroup, and WikiPageMessageGroup.
Definition at line 148 of file MessageGroupOld.php.
Referenced by getDefinitions(), and isSourceLanguage().
MessageGroupOld::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 CoreMessageGroup.
Definition at line 330 of file MessageGroupOld.php.
Referenced by initCollection().
MessageGroupOld::getTranslatableLanguages | ( | ) |
Get all the translatable languages for a group, considering the whitelisting and blacklisting.
Implements MessageGroup.
Definition at line 392 of file MessageGroupOld.php.
MessageGroupOld::getTranslationAids | ( | ) |
List of available message types mapped to the classes implementing them.
Default implementation (all).
Implements MessageGroup.
Definition at line 410 of file MessageGroupOld.php.
MessageGroupOld::getUniqueDefinitions | ( | ) |
This function can be used for meta message groups to list their "own" messages.
For example branched message groups can exclude the messages they share with each other.
Reimplemented in CoreMessageGroup.
Definition at line 217 of file MessageGroupOld.php.
Referenced by initCollection().
MessageGroupOld::getWorkflowConfiguration | ( | ) |
Definition at line 365 of file MessageGroupOld.php.
Referenced by getMessageGroupStates().
MessageGroupOld::getWriter | ( | ) |
Reimplemented in CoreMessageGroup.
Definition at line 180 of file MessageGroupOld.php.
MessageGroupOld::initCollection | ( | $ | code, | |
$ | unique = false | |||
) |
Creates a new MessageCollection for this group.
$code | String Language code for this collection. | |
$unique | Boolean Whether to build collection for messages unique to this group only. |
Definition at line 298 of file MessageGroupOld.php.
MessageGroupOld::isMeta | ( | ) |
Implements MessageGroup.
Definition at line 140 of file MessageGroupOld.php.
MessageGroupOld::isSourceLanguage | ( | $ | code | ) | [protected] |
$code | string |
Definition at line 347 of file MessageGroupOld.php.
Referenced by WikiPageMessageGroup::getMessage(), WikiPageMessageGroup::load(), and CoreMessageGroup::load().
MessageGroupOld::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 |
Implements MessageGroup.
Reimplemented in CoreMessageGroup, and WikiPageMessageGroup.
Definition at line 184 of file MessageGroupOld.php.
Referenced by getDefinitions(), and getMessage().
static MessageGroupOld::normaliseKeys | ( | $ | array | ) | [static] |
Definition at line 238 of file MessageGroupOld.php.
Referenced by getMessage().
MessageGroupOld::setConfiguration | ( | $ | conf | ) |
Definition at line 352 of file MessageGroupOld.php.
MessageGroupOld::setDescription | ( | $ | value | ) |
Definition at line 126 of file MessageGroupOld.php.
MessageGroupOld::setId | ( | $ | value | ) |
$value | string |
Definition at line 56 of file MessageGroupOld.php.
MessageGroupOld::setIgnored | ( | $ | value | ) |
$value | array |
Definition at line 112 of file MessageGroupOld.php.
MessageGroupOld::setLabel | ( | $ | value | ) |
$value | string |
Definition at line 37 of file MessageGroupOld.php.
MessageGroupOld::setMangler | ( | $ | value | ) |
Definition at line 169 of file MessageGroupOld.php.
MessageGroupOld::setMeta | ( | $ | value | ) |
Definition at line 144 of file MessageGroupOld.php.
MessageGroupOld::setNamespace | ( | $ | ns | ) |
Set the namespace where all the messages of this group belong.
Definition at line 73 of file MessageGroupOld.php.
MessageGroupOld::setOptional | ( | $ | value | ) |
$value | array |
Definition at line 93 of file MessageGroupOld.php.
MessageGroupOld::$description = null [protected] |
Holds descripton of this group.
Description is a wiki text snippet that gives information about this group to translators.
Reimplemented in CoreMessageGroup, and CoreMostUsedMessageGroup.
Definition at line 120 of file MessageGroupOld.php.
MessageGroupOld::$id = 'none' [protected] |
Group-wide unique id of this group.
Used also for sorting.
Reimplemented in CoreMessageGroup, and CoreMostUsedMessageGroup.
Definition at line 44 of file MessageGroupOld.php.
Referenced by MockWikiMessageGroup::__construct(), WikiPageMessageGroup::__construct(), and WikiMessageGroup::__construct().
MessageGroupOld::$ignored = array() [protected] |
List of messages that are always hidden and cannot be translated.
Definition at line 100 of file MessageGroupOld.php.
MessageGroupOld::$label = 'none' [protected] |
Human-readable name of this group.
Reimplemented in CoreMessageGroup, and CoreMostUsedMessageGroup.
Definition at line 24 of file MessageGroupOld.php.
MessageGroupOld::$mangler = null [protected] |
To avoid key conflicts between groups or separated changed messages between branches one can set a message key mangler.
Definition at line 156 of file MessageGroupOld.php.
Referenced by CoreMessageGroup::getTags(), and CoreMessageGroup::load().
MessageGroupOld::$messages = array() [private] |
All the messages for this group, by language code.
Definition at line 255 of file MessageGroupOld.php.
Referenced by WikiMessageGroup::getDefinitions(), CoreMostUsedMessageGroup::getDefinitions(), load(), and CoreMessageGroup::load().
MessageGroupOld::$meta = false [protected] |
Meta groups consist of multiple groups or parts of other groups.
This info is used on many places, like when creating message index.
Reimplemented in CoreMostUsedMessageGroup.
Definition at line 138 of file MessageGroupOld.php.
MessageGroupOld::$namespace = NS_MEDIAWIKI [protected] |
The namespace where all the messages of this group belong.
If the group has messages from multiple namespaces, set this to false and look how RecentMessageGroup implements the definitions.
Reimplemented in RecentMessageGroup, and SandboxMessageGroup.
Definition at line 65 of file MessageGroupOld.php.
MessageGroupOld::$optional = array() [protected] |
List of messages that are hidden by default, but can still be translated if needed.
Definition at line 81 of file MessageGroupOld.php.