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 21 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 37 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 81 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 43 of file PremadeMediawikiExtensionGroups.php.

◆ getNamespace()

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

Get the namespace ID.

Definition at line 48 of file PremadeMediawikiExtensionGroups.php.

◆ parseFile()

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

Definition at line 164 of file PremadeMediawikiExtensionGroups.php.

◆ processGroups()

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

Definition at line 245 of file PremadeMediawikiExtensionGroups.php.

◆ register()

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

Hook: TranslatePostInitGroups.

Definition at line 66 of file PremadeMediawikiExtensionGroups.php.

◆ setGroupPrefix()

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

How to prefix message group ids.

Definition at line 56 of file PremadeMediawikiExtensionGroups.php.

◆ setNamespace()

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

Which namespace holds the messages.

Definition at line 61 of file PremadeMediawikiExtensionGroups.php.

Member Data Documentation

◆ $definitionFile

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

Definition at line 27 of file PremadeMediawikiExtensionGroups.php.

◆ $idPrefix

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

Definition at line 22 of file PremadeMediawikiExtensionGroups.php.

◆ $namespace

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

Definition at line 23 of file PremadeMediawikiExtensionGroups.php.

◆ $path

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

Definition at line 25 of file PremadeMediawikiExtensionGroups.php.


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