Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MessageGroupBase.php
Go to the documentation of this file.
1<?php
11use MediaWiki\Context\IContextSource;
20use MediaWiki\Languages\LanguageNameUtils;
21use MediaWiki\Linker\LinkTarget;
22use MediaWiki\MediaWikiServices;
23
33abstract class MessageGroupBase implements MessageGroup {
35 protected $conf;
37 protected $namespace;
39 protected $mangler;
40
41 protected function __construct() {
42 }
43
49 public static function factory( $conf ) {
50 $obj = new $conf['BASIC']['class']();
51 $obj->conf = $conf;
52 $obj->namespace = $obj->parseNamespace();
53
54 return $obj;
55 }
56
57 public function getConfiguration() {
58 return $this->conf;
59 }
60
61 public function getId() {
62 return $this->getFromConf( 'BASIC', 'id' );
63 }
64
65 public function getLabel( ?IContextSource $context = null ) {
66 return $this->getFromConf( 'BASIC', 'label' );
67 }
68
69 public function getDescription( ?IContextSource $context = null ) {
70 return $this->getFromConf( 'BASIC', 'description' );
71 }
72
73 public function getIcon() {
74 return $this->getFromConf( 'BASIC', 'icon' );
75 }
76
77 public function getNamespace() {
78 return $this->namespace;
79 }
80
81 public function isMeta() {
82 return $this->getFromConf( 'BASIC', 'meta' );
83 }
84
85 public function getSourceLanguage() {
86 $conf = $this->getFromConf( 'BASIC', 'sourcelanguage' );
87
88 return $conf ?? 'en';
89 }
90
91 public function getDefinitions() {
92 $defs = $this->load( $this->getSourceLanguage() );
93
94 return $defs;
95 }
96
97 protected function getFromConf( $section, $key = null ) {
98 if ( $key === null ) {
99 return $this->conf[$section] ?? null;
100 }
101 return $this->conf[$section][$key] ?? null;
102 }
103
104 public function getValidator() {
105 $validatorConfigs = $this->getFromConf( 'VALIDATORS' );
106 if ( $validatorConfigs === null ) {
107 return null;
108 }
109
110 $msgValidator = new ValidationRunner( $this->getId() );
111
112 foreach ( $validatorConfigs as $config ) {
113 try {
114 $msgValidator->addValidator( $config );
115 } catch ( Exception $e ) {
116 $id = $this->getId();
117 throw new InvalidArgumentException(
118 "Unable to construct validator for message group $id: " . $e->getMessage(),
119 0,
120 $e
121 );
122 }
123 }
124
125 return $msgValidator;
126 }
127
128 public function getMangler() {
129 if ( $this->mangler === null ) {
130 $class = $this->getFromConf( 'MANGLER', 'class' ) ?? StringMatcher::class;
131
132 if ( $class === 'StringMatcher' || $class === StringMatcher::class ) {
133 $this->mangler = new StringMatcher();
134 $manglerConfig = $this->conf['MANGLER'] ?? null;
135 if ( $manglerConfig ) {
136 $this->mangler->setConf( $manglerConfig );
137 }
138
139 return $this->mangler;
140 }
141
142 throw new InvalidArgumentException(
143 'Unable to create StringMangler for group ' . $this->getId() . ': ' .
144 "Custom StringManglers ($class) are currently not supported."
145 );
146 }
147
148 return $this->mangler;
149 }
150
156 public function getInsertablesSuggester() {
157 $suggesters = [];
158 $insertableConf = $this->getFromConf( 'INSERTABLES' ) ?? [];
159
160 foreach ( $insertableConf as $config ) {
161 if ( !isset( $config['class'] ) ) {
162 throw new InvalidArgumentException(
163 'Insertable configuration for group: ' . $this->getId() .
164 ' does not provide a class.'
165 );
166 }
167
168 if ( !is_string( $config['class'] ) ) {
169 throw new InvalidArgumentException(
170 'Expected Insertable class to be string, got: ' . get_debug_type( $config['class'] ) .
171 ' for group: ' . $this->getId()
172 );
173 }
174
175 $suggesters[] = InsertableFactory::make( $config['class'], $config['params'] ?? [] );
176 }
177
178 // Get validators marked as insertable
179 $messageValidator = $this->getValidator();
180 if ( $messageValidator ) {
181 $suggesters = array_merge( $suggesters, $messageValidator->getInsertableValidators() );
182 }
183
184 return new CombinedInsertablesSuggester( $suggesters );
185 }
186
188 public function getKeys() {
189 return array_keys( $this->getDefinitions() );
190 }
191
192 public function getTags( $type = null ) {
193 if ( $type === null ) {
194 $taglist = [];
195
196 foreach ( $this->getRawTags() as $type => $patterns ) {
197 $taglist[$type] = $this->parseTags( $patterns );
198 }
199
200 return $taglist;
201 } else {
202 return $this->parseTags( $this->getRawTags( $type ) );
203 }
204 }
205
206 protected function parseTags( $patterns ) {
207 $messageKeys = $this->getKeys();
208
209 $matches = [];
210
214 foreach ( $patterns as $index => $pattern ) {
215 if ( !str_contains( $pattern, '*' ) ) {
216 $matches[] = $pattern;
217 unset( $patterns[$index] );
218 }
219 }
220
221 if ( count( $patterns ) ) {
225 $mangler = new StringMatcher( '', $patterns );
226
230 foreach ( $messageKeys as $key ) {
231 if ( $mangler->matches( $key ) ) {
232 $matches[] = $key;
233 }
234 }
235 }
236
237 return $matches;
238 }
239
240 protected function getRawTags( $type = null ) {
241 if ( !isset( $this->conf['TAGS'] ) ) {
242 return [];
243 }
244
245 $tags = $this->conf['TAGS'];
246 if ( !$type ) {
247 return $tags;
248 }
249
250 return $tags[$type] ?? [];
251 }
252
253 protected function setTags( MessageCollection $collection ) {
254 foreach ( $this->getTags() as $type => $tags ) {
255 $collection->setTags( $type, $tags );
256 }
257 }
258
259 protected function parseNamespace() {
260 $ns = $this->getFromConf( 'BASIC', 'namespace' );
261
262 if ( is_int( $ns ) ) {
263 return $ns;
264 }
265
266 if ( defined( $ns ) ) {
267 return constant( $ns );
268 }
269
270 $index = MediaWikiServices::getInstance()->getContentLanguage()
271 ->getNsIndex( $ns );
272
273 if ( !$index ) {
274 throw new RuntimeException( "No valid namespace defined, got $ns." );
275 }
276
277 return $index;
278 }
279
280 protected function isSourceLanguage( $code ) {
281 return $code === $this->getSourceLanguage();
282 }
283
288 public function getMessageGroupStates() {
289 global $wgTranslateWorkflowStates;
290 $conf = $wgTranslateWorkflowStates ?: [];
291
292 Services::getInstance()->getHookRunner()
293 ->onTranslate_modifyMessageGroupStates( $this->getId(), $conf );
294
295 return new MessageGroupStates( $conf );
296 }
297
299 public function getTranslatableLanguages() {
300 $groupConfiguration = $this->getConfiguration();
301 if ( !isset( $groupConfiguration['LANGUAGES'] ) ) {
302 // No LANGUAGES section in the configuration.
303 return null;
304 }
305
306 $codes = array_flip( array_keys( Utilities::getLanguageNames( LanguageNameUtils::AUTONYMS ) ) );
307
308 $lists = $groupConfiguration['LANGUAGES'];
309 $exclusionList = $lists['exclude'] ?? null;
310 if ( $exclusionList !== null ) {
311 if ( $exclusionList === '*' ) {
312 // All excluded languages
313 $codes = [];
314 } elseif ( is_array( $exclusionList ) ) {
315 foreach ( $exclusionList as $code ) {
316 unset( $codes[$code] );
317 }
318 }
319 } else {
320 // Treat lack of explicit exclusion list the same as excluding everything. This way,
321 // when one defines only inclusions, it means that only those languages are allowed.
322 $codes = [];
323 }
324
325 $disabledLanguages = Services::getInstance()->getConfigHelper()->getDisabledTargetLanguages();
326 // DWIM with $wgTranslateDisabledTargetLanguages, e.g. languages in that list should not unexpectedly
327 // be enabled when an inclusion list is used to include any language.
328 $checks = [ $this->getId(), strtok( $this->getId(), '-' ), '*' ];
329 foreach ( $checks as $check ) {
330 if ( isset( $disabledLanguages[ $check ] ) ) {
331 foreach ( array_keys( $disabledLanguages[ $check ] ) as $excludedCode ) {
332 unset( $codes[ $excludedCode ] );
333 }
334 }
335 }
336
337 $inclusionList = $lists['include'] ?? null;
338 if ( $inclusionList !== null ) {
339 if ( $inclusionList === '*' ) {
340 // All languages included (except $wgTranslateDisabledTargetLanguages)
341 return null;
342 } elseif ( is_array( $inclusionList ) ) {
343 foreach ( $inclusionList as $code ) {
344 $codes[$code] = true;
345 }
346 }
347 }
348
349 return $codes;
350 }
351
352 public function getSupportConfig(): ?array {
353 return $this->getFromConf( 'BASIC', 'support' );
354 }
355
357 public function getRelatedPage(): ?LinkTarget {
358 return null;
359 }
360}
return[ 'Translate:AggregateGroupManager'=> static function(MediaWikiServices $services):AggregateGroupManager { return new AggregateGroupManager($services->getTitleFactory(), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:AggregateGroupMessageGroupFactory'=> static function(MediaWikiServices $services):AggregateGroupMessageGroupFactory { return new AggregateGroupMessageGroupFactory($services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:ConfigHelper'=> static function():ConfigHelper { return new ConfigHelper();}, 'Translate:CsvTranslationImporter'=> static function(MediaWikiServices $services):CsvTranslationImporter { return new CsvTranslationImporter( $services->getWikiPageFactory());}, 'Translate:EntitySearch'=> static function(MediaWikiServices $services):EntitySearch { return new EntitySearch($services->getMainWANObjectCache(), $services->getCollationFactory() ->makeCollation( 'uca-default-u-kn'), MessageGroups::singleton(), $services->getNamespaceInfo(), $services->get( 'Translate:MessageIndex'), $services->getTitleParser(), $services->getTitleFormatter());}, 'Translate:ExternalMessageSourceStateComparator'=> static function(MediaWikiServices $services):ExternalMessageSourceStateComparator { return new ExternalMessageSourceStateComparator(new SimpleStringComparator(), $services->getRevisionLookup(), $services->getPageStore());}, 'Translate:ExternalMessageSourceStateImporter'=> static function(MediaWikiServices $services):ExternalMessageSourceStateImporter { return new ExternalMessageSourceStateImporter($services->get( 'Translate:GroupSynchronizationCache'), $services->getJobQueueGroup(), LoggerFactory::getInstance(LogNames::GROUP_SYNCHRONIZATION), $services->get( 'Translate:MessageIndex'), $services->getTitleFactory(), $services->get( 'Translate:MessageGroupSubscription'), new ServiceOptions(ExternalMessageSourceStateImporter::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:FileBasedMessageGroupFactory'=> static function(MediaWikiServices $services):FileBasedMessageGroupFactory { return new FileBasedMessageGroupFactory(new MessageGroupConfigurationParser(), new ServiceOptions(FileBasedMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:FileFormatFactory'=> static function(MediaWikiServices $services):FileFormatFactory { return new FileFormatFactory( $services->getObjectFactory());}, 'Translate:GroupSynchronizationCache'=> static function(MediaWikiServices $services):GroupSynchronizationCache { return new GroupSynchronizationCache( $services->get( 'Translate:PersistentCache'));}, 'Translate:HookDefinedMessageGroupFactory'=> static function(MediaWikiServices $services):HookDefinedMessageGroupFactory { return new HookDefinedMessageGroupFactory( $services->get( 'Translate:HookRunner'));}, 'Translate:HookRunner'=> static function(MediaWikiServices $services):HookRunner { return new HookRunner( $services->getHookContainer());}, 'Translate:MessageBundleDependencyPurger'=> static function(MediaWikiServices $services):MessageBundleDependencyPurger { return new MessageBundleDependencyPurger( $services->get( 'Translate:TranslatableBundleFactory'));}, 'Translate:MessageBundleMessageGroupFactory'=> static function(MediaWikiServices $services):MessageBundleMessageGroupFactory { return new MessageBundleMessageGroupFactory($services->get( 'Translate:MessageGroupMetadata'), new ServiceOptions(MessageBundleMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:MessageBundleStore'=> static function(MediaWikiServices $services):MessageBundleStore { return new MessageBundleStore($services->get( 'Translate:RevTagStore'), $services->getJobQueueGroup(), $services->getLanguageNameUtils(), $services->get( 'Translate:MessageIndex'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:MessageBundleTranslationLoader'=> static function(MediaWikiServices $services):MessageBundleTranslationLoader { return new MessageBundleTranslationLoader( $services->getLanguageFallback());}, 'Translate:MessageGroupMetadata'=> static function(MediaWikiServices $services):MessageGroupMetadata { return new MessageGroupMetadata( $services->getConnectionProvider());}, 'Translate:MessageGroupReviewStore'=> static function(MediaWikiServices $services):MessageGroupReviewStore { return new MessageGroupReviewStore($services->getConnectionProvider(), $services->get( 'Translate:HookRunner'));}, 'Translate:MessageGroupStatsTableFactory'=> static function(MediaWikiServices $services):MessageGroupStatsTableFactory { return new MessageGroupStatsTableFactory($services->get( 'Translate:ProgressStatsTableFactory'), $services->getLinkRenderer(), $services->get( 'Translate:MessageGroupReviewStore'), $services->get( 'Translate:MessageGroupMetadata'), $services->getMainConfig() ->get( 'TranslateWorkflowStates') !==false);}, 'Translate:MessageGroupSubscription'=> static function(MediaWikiServices $services):MessageGroupSubscription { return new MessageGroupSubscription($services->get( 'Translate:MessageGroupSubscriptionStore'), $services->getJobQueueGroup(), $services->getUserIdentityLookup(), LoggerFactory::getInstance(LogNames::GROUP_SUBSCRIPTION), new ServiceOptions(MessageGroupSubscription::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:MessageGroupSubscriptionHookHandler'=> static function(MediaWikiServices $services):MessageGroupSubscriptionHookHandler { return new MessageGroupSubscriptionHookHandler($services->get( 'Translate:MessageGroupSubscription'), $services->getUserFactory());}, 'Translate:MessageGroupSubscriptionStore'=> static function(MediaWikiServices $services):MessageGroupSubscriptionStore { return new MessageGroupSubscriptionStore( $services->getConnectionProvider());}, 'Translate:MessageIndex'=> static function(MediaWikiServices $services):MessageIndex { $params=(array) $services->getMainConfig() ->get( 'TranslateMessageIndex');$class=array_shift( $params);$implementationMap=['HashMessageIndex'=> HashMessageIndex::class, 'CDBMessageIndex'=> CDBMessageIndex::class, 'DatabaseMessageIndex'=> DatabaseMessageIndex::class, 'hash'=> HashMessageIndex::class, 'cdb'=> CDBMessageIndex::class, 'database'=> DatabaseMessageIndex::class,];$messageIndexStoreClass=$implementationMap[$class] ?? $implementationMap['database'];return new MessageIndex(new $messageIndexStoreClass, $services->getMainWANObjectCache(), $services->getJobQueueGroup(), $services->get( 'Translate:HookRunner'), LoggerFactory::getInstance(LogNames::MAIN), $services->getMainObjectStash(), $services->getConnectionProvider(), new ServiceOptions(MessageIndex::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:MessagePrefixStats'=> static function(MediaWikiServices $services):MessagePrefixStats { return new MessagePrefixStats( $services->getTitleParser());}, 'Translate:ParsingPlaceholderFactory'=> static function():ParsingPlaceholderFactory { return new ParsingPlaceholderFactory();}, 'Translate:PersistentCache'=> static function(MediaWikiServices $services):PersistentCache { return new PersistentDatabaseCache($services->getConnectionProvider(), $services->getJsonCodec());}, 'Translate:ProgressStatsTableFactory'=> static function(MediaWikiServices $services):ProgressStatsTableFactory { return new ProgressStatsTableFactory($services->getLinkRenderer(), $services->get( 'Translate:ConfigHelper'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:RevTagStore'=> static function(MediaWikiServices $services):RevTagStore { return new RevTagStore( $services->getConnectionProvider());}, 'Translate:SubpageListBuilder'=> static function(MediaWikiServices $services):SubpageListBuilder { return new SubpageListBuilder($services->get( 'Translate:TranslatableBundleFactory'), $services->getLinkBatchFactory());}, 'Translate:TranslatableBundleDeleter'=> static function(MediaWikiServices $services):TranslatableBundleDeleter { return new TranslatableBundleDeleter($services->getMainObjectStash(), $services->getJobQueueGroup(), $services->get( 'Translate:SubpageListBuilder'), $services->get( 'Translate:TranslatableBundleFactory'));}, 'Translate:TranslatableBundleExporter'=> static function(MediaWikiServices $services):TranslatableBundleExporter { return new TranslatableBundleExporter($services->get( 'Translate:SubpageListBuilder'), $services->getWikiExporterFactory(), $services->getConnectionProvider());}, 'Translate:TranslatableBundleFactory'=> static function(MediaWikiServices $services):TranslatableBundleFactory { return new TranslatableBundleFactory($services->get( 'Translate:TranslatablePageStore'), $services->get( 'Translate:MessageBundleStore'));}, 'Translate:TranslatableBundleImporter'=> static function(MediaWikiServices $services):TranslatableBundleImporter { return new TranslatableBundleImporter($services->getWikiImporterFactory(), $services->get( 'Translate:TranslatablePageParser'), $services->getRevisionLookup(), $services->getNamespaceInfo(), $services->getTitleFactory(), $services->getFormatterFactory());}, 'Translate:TranslatableBundleMover'=> static function(MediaWikiServices $services):TranslatableBundleMover { return new TranslatableBundleMover($services->getMovePageFactory(), $services->getJobQueueGroup(), $services->getLinkBatchFactory(), $services->get( 'Translate:TranslatableBundleFactory'), $services->get( 'Translate:SubpageListBuilder'), $services->getConnectionProvider(), $services->getObjectCacheFactory(), $services->getMainConfig() ->get( 'TranslatePageMoveLimit'));}, 'Translate:TranslatableBundleStatusStore'=> static function(MediaWikiServices $services):TranslatableBundleStatusStore { return new TranslatableBundleStatusStore($services->getConnectionProvider() ->getPrimaryDatabase(), $services->getCollationFactory() ->makeCollation( 'uca-default-u-kn'), $services->getDBLoadBalancer() ->getMaintenanceConnectionRef(DB_PRIMARY));}, 'Translate:TranslatablePageMarker'=> static function(MediaWikiServices $services):TranslatablePageMarker { return new TranslatablePageMarker($services->getConnectionProvider(), $services->getJobQueueGroup(), $services->getLinkRenderer(), MessageGroups::singleton(), $services->get( 'Translate:MessageIndex'), $services->getTitleFormatter(), $services->getTitleParser(), $services->get( 'Translate:TranslatablePageParser'), $services->get( 'Translate:TranslatablePageStore'), $services->get( 'Translate:TranslatablePageStateStore'), $services->get( 'Translate:TranslationUnitStoreFactory'), $services->get( 'Translate:MessageGroupMetadata'), $services->getWikiPageFactory(), $services->get( 'Translate:TranslatablePageView'), $services->get( 'Translate:MessageGroupSubscription'), $services->getFormatterFactory());}, 'Translate:TranslatablePageMessageGroupFactory'=> static function(MediaWikiServices $services):TranslatablePageMessageGroupFactory { return new TranslatablePageMessageGroupFactory(new ServiceOptions(TranslatablePageMessageGroupFactory::SERVICE_OPTIONS, $services->getMainConfig()),);}, 'Translate:TranslatablePageParser'=> static function(MediaWikiServices $services):TranslatablePageParser { return new TranslatablePageParser($services->get( 'Translate:ParsingPlaceholderFactory'));}, 'Translate:TranslatablePageStateStore'=> static function(MediaWikiServices $services):TranslatablePageStateStore { return new TranslatablePageStateStore($services->get( 'Translate:PersistentCache'), $services->getPageStore());}, 'Translate:TranslatablePageStore'=> static function(MediaWikiServices $services):TranslatablePageStore { return new TranslatablePageStore($services->get( 'Translate:MessageIndex'), $services->getJobQueueGroup(), $services->get( 'Translate:RevTagStore'), $services->getConnectionProvider(), $services->get( 'Translate:TranslatableBundleStatusStore'), $services->get( 'Translate:TranslatablePageParser'), $services->get( 'Translate:MessageGroupMetadata'));}, 'Translate:TranslatablePageView'=> static function(MediaWikiServices $services):TranslatablePageView { return new TranslatablePageView($services->getConnectionProvider(), $services->get( 'Translate:TranslatablePageStateStore'), new ServiceOptions(TranslatablePageView::SERVICE_OPTIONS, $services->getMainConfig()));}, 'Translate:TranslateSandbox'=> static function(MediaWikiServices $services):TranslateSandbox { return new TranslateSandbox($services->getUserFactory(), $services->getConnectionProvider(), $services->getPermissionManager(), $services->getAuthManager(), $services->getUserGroupManager(), $services->getActorStore(), $services->getUserOptionsManager(), $services->getJobQueueGroup(), $services->get( 'Translate:HookRunner'), new ServiceOptions(TranslateSandbox::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'Translate:TranslationStashReader'=> static function(MediaWikiServices $services):TranslationStashReader { return new TranslationStashStorage( $services->getConnectionProvider() ->getPrimaryDatabase());}, 'Translate:TranslationStatsDataProvider'=> static function(MediaWikiServices $services):TranslationStatsDataProvider { return new TranslationStatsDataProvider(new ServiceOptions(TranslationStatsDataProvider::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getObjectFactory(), $services->getConnectionProvider());}, 'Translate:TranslationUnitStoreFactory'=> static function(MediaWikiServices $services):TranslationUnitStoreFactory { return new TranslationUnitStoreFactory( $services->getDBLoadBalancer());}, 'Translate:TranslatorActivity'=> static function(MediaWikiServices $services):TranslatorActivity { $query=new TranslatorActivityQuery($services->getMainConfig(), $services->getDBLoadBalancer());return new TranslatorActivity($services->getMainObjectStash(), $query, $services->getJobQueueGroup());}, 'Translate:TtmServerFactory'=> static function(MediaWikiServices $services):TtmServerFactory { $config=$services->getMainConfig();$default=$config->get( 'TranslateTranslationDefaultService');if( $default===false) { $default=null;} return new TtmServerFactory( $config->get( 'TranslateTranslationServices'), $default);}]
@phpcs-require-sorted-array
This file contains the class for core message collections implementation.
The versatile default implementation of StringMangler interface.
Minimal service container.
Definition Services.php:59
A factory class used to instantiate instances of Insertables.
Essentially random collection of helper functions, similar to GlobalFunctions.php.
Definition Utilities.php:31
Message validator is used to run validators to find common mistakes so that translators can fix them ...
This class implements some basic functions that wrap around the YAML message group configurations.
getTranslatableLanguages()
@inheritDoc
getDefinitions()
Shortcut for load( getSourceLanguage() ).
getDescription(?IContextSource $context=null)
Returns a longer description about the group.
getTags( $type=null)
Returns message tags.
getSourceLanguage()
Returns language code depicting the language of source text.
getNamespace()
Returns the namespace where messages are placed.
getSupportConfig()
Gets support URL defined for the group if any.
getMessageGroupStates()
Get the message group workflow state configuration.
getMangler()
Return a message mangler or null.
getId()
Returns the unique identifier for this group.
getLabel(?IContextSource $context=null)
Returns the human readable label (as plain text).
getInsertablesSuggester()
Returns the configured InsertablesSuggester if any.
getValidator()
Returns a message validator object or null.
static factory( $conf)
getIcon()
Returns an icon for this message group if any.
getRelatedPage()
@inheritDoc
Interface for message groups.
load( $code)
Returns a list of messages in a given language code.