Help:Extension:Translate/Components

Translate extension is extensible in many ways. The most likely ways to extend Translate is to add support for new file formats (link to section) or new message groups (link to section). Sometimes it is also useful to write a new message checks (link to section) or to extend Translate via hooks (link to section). Sometimes you might get along only by using the existing web API.

In addition to the concepts already mentioned, there are many more important concepts and classes in Translate that are useful to understand when hacking Translate. This pages aims to comprehensively detail all components of Translate.

WebAPI

 * In-depth documentation at Translate API

In addition to hooks and interfaces that can only be used from PHP code, the WebAPI provides access to many message group and translating related information and actions. It is based on the MediaWiki API framework, supporting many output formats like json and xml.

File format support (FFS)

 * In-depth documentation at X
 * List of supported file formats at X
 * Tutorial for writing FFS classes at X

The Translate extension supports translating of non-wiki content like software interface messages via File format support (FFS) classes. These classes implement the FFS interface and abstract away parsing and generating of file contents. The FFS classes are used by FileBasedMessageGroup class via the YAML configuration files.

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.

Ttmserver (translation memory)

 * In-depth documentation at Translation memories.
 * Blog post of history of this feature at Niklas' blog.

Ttmserver is the name of translation memory interface. It supports multiple backends for inserting and querying translation suggestions. The code is located under  directory.