Help:Extension:Translate/Message groups

Message groups bring together a collection of messages. They come with a description and dictate the namespace where messages are stored, how can they be exported (usually via FFS) how are the definitions loaded (like from wiki pages, or via FFS) and other things.

Message group hierarchy
MessageGroupBase ! MessageGroupOld !
 * AggregateMessageGroup
 * FileBasedMessageGroup
 * SingleFileBasedMessageGroup
 * CoreMessageGroup
 * CoreMostUsedMessageGroup
 * ExtensionMessageGroup
 * AliasMessageGroup
 * WikiMessageGroup
 * RecentMessageGroup
 * SvgMessageGroup !!
 * WikiPageMessageGroup !!!
 * WorkflowStatesMessageGroup

! MessageGroupBase is the more recent base class. These groups are usually defined via the Yaml configuration, while the ones extending MessageGroupOld are defined in other ways. Core and extension message groups are for MediaWiki and are waiting to be migrated to FileBasedMessageGroup.

!! In TranslateSvg extension.

!!! Provides the page translation feature.

Main functions
Basic info. Each message group has an unique id (within a wiki), a label (short name) and a short description, than includes important information like licensing and link to page which has more information.

Namespace. All the definitions of messages and translations are placed in a namespace given by the message group. The file based message groups allow users to set the namespace, while other are hard coded to NS_TRANSLATIONS (page translation) or NS_MEDIAWIKI.

Checkers. Message groups can give a list of message checkers, that can warn the user. Common checks are for missing or unknown variables and invalid html.

Mangler. Each group has a message key mangler. It is mostly relevant only to file based message groups where the format of message keys cannot be enforced. See mangler section below.

Message loading. There are many methods for loading message definitions. The load method usually reads the messages from files via FFS class or from a database table. getDefinitions is a shortcut for loading the messages in the source language (see below).

Source language. All of the message definitions are expected to be in a single language. Only dynamic message groups like RecentMessageGroup can work around this limitation.

Tags. Messages can have tags. Tags ignored and optional are often used. In addition message collection provides its own additional tags.

Workflow states. Message groups can override the global workflow states.

Languages. By default all known languages can be translated into. The message groups can provide a subset of languages to disable translation in other languages.