Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWikiExtensionMessageGroup.php
1<?php
2declare( strict_types = 1 );
3
18 public function getDescription( IContextSource $context = null ) {
19 $language = $this->getSourceLanguage();
20 if ( $context ) {
21 $language = $context->getLanguage()->getCode();
22 }
23
24 $msgkey = $this->getFromConf( 'BASIC', 'descriptionmsg' );
25 $desc = '';
26 if ( $msgkey ) {
27 $desc = $this->getMessage( $msgkey, $language );
28 if ( (string)$desc === '' ) {
29 $desc = $this->getMessage( $msgkey, $this->getSourceLanguage() );
30 }
31 }
32
33 if ( (string)$desc === '' ) {
34 // That failed, default to 'description'
35 $desc = parent::getDescription( $context );
36 }
37
38 return $desc;
39 }
40}
This class implements default behavior for file based message groups.
getMessage( $key, $code)
@inheritDoc
Message group for MediaWiki extensions.
getDescription(IContextSource $context=null)
MediaWiki extensions all should have key in their i18n files describing them.
getSourceLanguage()
Returns language code depicting the language of source text.