MessageGroupOld Class Reference
[Message group]

This is the interface and base implementation of unmanaged message groups. More...

Inheritance diagram for MessageGroupOld:
Inheritance graph
[legend]
Collaboration diagram for MessageGroupOld:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

This is the interface and base implementation of unmanaged message groups.

Todo:
Rename the class

Definition at line 20 of file MessageGroupOld.php.


Constructor & Destructor Documentation

MessageGroupOld::__construct (  ) 

Member Function Documentation

static MessageGroupOld::addContext ( Message $  message,
IContextSource $  context = null 
) [static, protected]
MessageGroupOld::exists (  ) 

Can be overwritten to retun false if something is wrong.

Returns:
bool

Implements MessageGroup.

Definition at line 322 of file MessageGroupOld.php.

MessageGroupOld::getChecker (  ) 

Returns a message checker object or null.

Todo:
Make an interface for message checkers.
Returns:
MessageChecker 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.

Todo:
Remove from the interface. Only usage is in FFS. Figure out a better way.
Returns:
array

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.

Exceptions:
MWException 
Returns:
Array of messages definitions indexed by key.

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().

Here is the call graph for this function:

MessageGroupOld::getDescription ( IContextSource $  context = null  ) 

Returns a longer description about the group.

Description can use wikitext. Parameter $context was added in 2012-10-22.

Parameters:
IContextSource $context Context can be used by subclasses to provide translated descriptions, for example.
Returns:
string

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.

Returns:
FFS or null

Implements MessageGroup.

Definition at line 358 of file MessageGroupOld.php.

MessageGroupOld::getIcon (  ) 

Returns an icon for this message group if any.

Returns:
string|null File reference in one of the supported protocols:
Since:
2012-12-04

Implements MessageGroup.

Reimplemented in CoreMessageGroup.

Definition at line 130 of file MessageGroupOld.php.

MessageGroupOld::getId (  ) 
Returns:
string

Implements MessageGroup.

Reimplemented in RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.

Definition at line 49 of file MessageGroupOld.php.

MessageGroupOld::getIgnored (  ) 
Returns:
array

Definition at line 105 of file MessageGroupOld.php.

MessageGroupOld::getLabel ( IContextSource $  context = null  ) 
Parameters:
IContextSource $context
Returns:
string

Implements MessageGroup.

Reimplemented in RecentAdditionsMessageGroup, RecentMessageGroup, SandboxMessageGroup, and WorkflowStatesMessageGroup.

Definition at line 30 of file MessageGroupOld.php.

Referenced by getDefinitions().

MessageGroupOld::getMangler (  ) 
Returns:
StringMatcher

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.

Parameters:
$key   String   Key of the message.
$code   String   Language code.
Returns:
Mixed List of stored translation or   Null  .

Implements MessageGroup.

Reimplemented in WikiMessageGroup, and WikiPageMessageGroup.

Definition at line 229 of file MessageGroupOld.php.

Here is the call graph for this function:

MessageGroupOld::getMessageFile ( code  ) 

Returns path to the file where translation of language code $code are.

Parameters:
string $code
Returns:
string Path to the file or false if not applicable.

Reimplemented in CoreMessageGroup.

Definition at line 263 of file MessageGroupOld.php.

Referenced by getMessageFileWithPath().

MessageGroupOld::getMessageFileWithPath ( code  ) 
Parameters:
$code 
Returns:
bool|string

Definition at line 275 of file MessageGroupOld.php.

Referenced by CoreMessageGroup::getReader(), getSourceFilePath(), and CoreMessageGroup::load().

Here is the call graph for this function:

MessageGroupOld::getMessageGroupStates (  ) 

Get the message group workflow state configuration.

Returns:
MessageGroupStates

Implements MessageGroup.

Reimplemented in MessageGroupWithoutTransitions, and MessageGroupWithTransitions.

Definition at line 381 of file MessageGroupOld.php.

Here is the call graph for this function:

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 (  ) 
Returns:
array

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  ) 

Definition at line 286 of file MessageGroupOld.php.

Here is the call graph for this function:

MessageGroupOld::getSourceLanguage (  ) 

Returns language code depicting the language of source text.

Returns:
string

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.

Parameters:
$type string
Returns:
array

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.

Returns:
array|null The language codes as array keys.

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).

Returns:
array

Implements MessageGroup.

Definition at line 410 of file MessageGroupOld.php.

Here is the call graph for this function:

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.

Returns:
array

Reimplemented in CoreMessageGroup.

Definition at line 217 of file MessageGroupOld.php.

Referenced by initCollection().

Here is the call graph for this function:

MessageGroupOld::getWorkflowConfiguration (  ) 
Deprecated:
Use getMessageGroupStates

Definition at line 365 of file MessageGroupOld.php.

Referenced by getMessageGroupStates().

MessageGroupOld::getWriter (  ) 
Returns:
SimpleFormatWriter

Reimplemented in CoreMessageGroup.

Definition at line 180 of file MessageGroupOld.php.

MessageGroupOld::initCollection ( code,
unique = false 
)

Creates a new MessageCollection for this group.

Parameters:
$code   String   Language code for this collection.
$unique   Boolean   Whether to build collection for messages unique to this group only.
Returns:
MessageCollection

Definition at line 298 of file MessageGroupOld.php.

Here is the call graph for this function:

MessageGroupOld::isMeta (  ) 
Todo:
Unclear usage. Perhaps rename to isSecondary with the only purpose suppress warnings about message key conflicts.
Returns:
bool

Implements MessageGroup.

Definition at line 140 of file MessageGroupOld.php.

MessageGroupOld::isSourceLanguage ( code  )  [protected]
Parameters:
$code string
Returns:
bool

Definition at line 347 of file MessageGroupOld.php.

Referenced by WikiPageMessageGroup::getMessage(), WikiPageMessageGroup::load(), and CoreMessageGroup::load().

Here is the call graph for this function:

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).

Parameters:
$code 
Returns:
array

Implements MessageGroup.

Reimplemented in CoreMessageGroup, and WikiPageMessageGroup.

Definition at line 184 of file MessageGroupOld.php.

Referenced by getDefinitions(), and getMessage().

Here is the call graph for this function:

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  ) 
Parameters:
$value string

Definition at line 56 of file MessageGroupOld.php.

MessageGroupOld::setIgnored ( value  ) 
Parameters:
$value array

Definition at line 112 of file MessageGroupOld.php.

MessageGroupOld::setLabel ( value  ) 
Parameters:
$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  ) 
Parameters:
$value array

Definition at line 93 of file MessageGroupOld.php.


Member Data Documentation

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.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:49 2013 for MediaWiki Translate Extension by  doxygen 1.6.3