Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups Class Reference

Class which handles special definition format for MediaWiki extensions and skins. More...

Inheritance diagram for MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups:
MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeIntuitionTextdomains

Public Member Functions

 __construct (string $def, string $path)
 
 setGroupPrefix (string $value)
 How to prefix message group ids.
 
 setNamespace (int $value)
 Which namespace holds the messages.
 
 register (array &$list, array &$deps)
 Hook: TranslatePostInitGroups.
 

Protected Member Functions

 getDefaultNamespace ()
 Get the default namespace.
 
 getNamespace ()
 Get the namespace ID.
 
 createMessageGroup (string $id, array $info)
 Creates MediaWikiExtensionMessageGroup objects from parsed data.
 
 parseFile ()
 
 processGroups (array $groups)
 

Protected Attributes

string $idPrefix = 'ext-'
 
int $namespace = null
 
string $path
 
string $definitionFile
 

Detailed Description

Class which handles special definition format for MediaWiki extensions and skins.

Author
Niklas Laxström @license GPL-2.0-or-later

Definition at line 22 of file PremadeMediaWikiExtensionGroups.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::__construct ( string $def,
string $path )
Parameters
string$defAbsolute path to the definition file. See tests/data/mediawiki-extensions.txt for example.
string$pathGeneral prefix to the file locations without the extension specific part. Should start with GROUPROOT%/ or otherwise export path will be wrong. The export path is constructed by replacing GROUPROOT%/ with target directory.

Reimplemented in MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeIntuitionTextdomains.

Definition at line 38 of file PremadeMediaWikiExtensionGroups.php.

Member Function Documentation

◆ createMessageGroup()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::createMessageGroup ( string $id,
array $info )
protected

Creates MediaWikiExtensionMessageGroup objects from parsed data.

Parameters
string$idunique group id already prefixed
array$infoarray of group info

Definition at line 82 of file PremadeMediaWikiExtensionGroups.php.

◆ getDefaultNamespace()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::getDefaultNamespace ( )
protected

Get the default namespace.

Subclasses can override this.

Reimplemented in MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeIntuitionTextdomains.

Definition at line 44 of file PremadeMediaWikiExtensionGroups.php.

◆ getNamespace()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::getNamespace ( )
protected

Get the namespace ID.

Definition at line 49 of file PremadeMediaWikiExtensionGroups.php.

◆ parseFile()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::parseFile ( )
protected

Definition at line 166 of file PremadeMediaWikiExtensionGroups.php.

◆ processGroups()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::processGroups ( array $groups)
protected

Definition at line 247 of file PremadeMediaWikiExtensionGroups.php.

◆ register()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::register ( array & $list,
array & $deps )

Hook: TranslatePostInitGroups.

Definition at line 67 of file PremadeMediaWikiExtensionGroups.php.

◆ setGroupPrefix()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::setGroupPrefix ( string $value)

How to prefix message group ids.

Definition at line 57 of file PremadeMediaWikiExtensionGroups.php.

◆ setNamespace()

MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::setNamespace ( int $value)

Which namespace holds the messages.

Definition at line 62 of file PremadeMediaWikiExtensionGroups.php.

Member Data Documentation

◆ $definitionFile

string MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::$definitionFile
protected
See also
__construct

Definition at line 28 of file PremadeMediaWikiExtensionGroups.php.

◆ $idPrefix

string MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::$idPrefix = 'ext-'
protected

Definition at line 23 of file PremadeMediaWikiExtensionGroups.php.

◆ $namespace

int MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::$namespace = null
protected

Definition at line 24 of file PremadeMediaWikiExtensionGroups.php.

◆ $path

string MediaWiki\Extension\Translate\MessageGroupConfiguration\PremadeMediaWikiExtensionGroups::$path
protected
See also
__construct

Definition at line 26 of file PremadeMediaWikiExtensionGroups.php.


The documentation for this class was generated from the following file: