Extension Localisation Wiki using Translate/Localisation Groups
From MediaWiki.org
A localisation group must be added for each extension that you wish to localise.
[edit] LocalSettings.php
The basic template below is used, but of course customized for each extension. Anything in triple triangle brackets must be altered and is listed below.
$wgHooks[ 'TranslatePostInitGroups' ][] = array( 'setupExtension<<<NAME>>>' ); function setupExtension<<<NAME>>>( &$cc ) { $id = 'Extension<<<NAME>>>'; $mg = new ExtensionMessageGroup; $mg->setId( $id ); $mg->setType( 'mediawiki' ); $mg->setLabel( '<<<NAME>>>' ); $mg->setDescription( '<<<DESCRIPTION>>>' ); $mg->setMessageFile( '<<<NAME>>>.i18n.php' ); $mg->namespaces = array( NS_TRANSLATE, NS_TRANSLATE + 1 ); $cc[ $id ] = $mg; return true; }
- Name
- Name of extension without spaces, e.g. "Translate".
- Description
- Description of extension (may contain wikitext). Templates can be used to allow descriptions to be defined on-wiki rather than within the
There are different types of group (such as FreeCol), but in the context of this guide only extension groups are relevant.
[edit] Message File
The message file (this should be in the standard MediaWiki message file format) must then be copied to extensions/messages/<<<NAME>>>.i18n.php.