Extension Localisation Wiki using Translate/Configuration

From MediaWiki.org

Jump to: navigation, search

Once installed, a variety of configuration settings are altered to provide a more effective localisation environment.

Contents

[edit] Translate

[edit] Documentation language code

The extension provides an ability for a language code to be used for documenting messages, making it easier for translators and localisers who may not always understand a messages context. The message for this language will be updated by someone familiar with the extension, perhaps the extensions developer.

$wgExtraLanguageNames[ 'documentation' ] = 'Message documentation'; # No linguistic content, used for documenting messages.
$wgTranslateDocumentationLanguageCode = 'documentation';

[edit] Dedicated translation namespace

To avoid conflicting between MediaWiki messages that are customized, and messages that are being Translated, a separate namespace is used for the translation of message.

define( 'NS_TRANSLATE', 100 );
$wgExtraNamespaces[ NS_TRANSLATE ]                  = 'Extension';
$wgExtraNamespaces[ NS_TRANSLATE + 1 ]              = 'Extension_talk';
$wgTranslateMessageNamespaces                       = array( NS_TRANSLATE );
$wgContentNamespaces[]                              = NS_TRANSLATE;
$wgNamespacesWithSubpages[ NS_TRANSLATE ]           = true;
$wgNamespacesWithSubpages[ NS_TRANSLATE + 1]        = true;
$wgNamespacesToBeSearchedDefault[ NS_TRANSLATE ]    = true;
 
$wgGroupPermissions[ 'translator' ][ 'translate' ]  = true;
$wgNamespaceProtection[ NS_TRANSLATE ]              = array( 'translate' );

This can be turned in to a function if more namespaces are desired.

[edit] Messages directory

Due to the nature of the extensions being localised, it makes sense to place them in a separate directory (rather than just put them with the rest of the extensions). They will instead be placed in the extensions/messages/ directory.

$wgTranslateExtensionDirectory = $IP . '/extensions/messages/';

[edit] Disable MediaWiki message localisation

Since we do not have any interest in localising MediaWiki messages (this is all handlled by translatewiki.net anyway) all message groups should be disabled for now - more will be added later on.

$wgTranslateEC = array();