MediaWiki REL1_31
ResourceLoaderLanguageDataModule.php
Go to the documentation of this file.
1<?php
29
30 protected $targets = [ 'desktop', 'mobile' ];
31
38 protected function getData( ResourceLoaderContext $context ) {
39 $language = Language::factory( $context->getLanguage() );
40 return [
41 'digitTransformTable' => $language->digitTransformTable(),
42 'separatorTransformTable' => $language->separatorTransformTable(),
43 'minimumGroupingDigits' => $language->minimumGroupingDigits(),
44 'grammarForms' => $language->getGrammarForms(),
45 'grammarTransformations' => $language->getGrammarTransformations(),
46 'pluralRules' => $language->getPluralRules(),
47 'digitGroupingPattern' => $language->digitGroupingPattern(),
48 'fallbackLanguages' => $language->getFallbackLanguages(),
49 ];
50 }
51
57 return Xml::encodeJsCall(
58 'mw.language.setData',
59 [
60 $context->getLanguage(),
61 $this->getData( $context )
62 ],
64 );
65 }
66
70 public function enableModuleContentVersion() {
71 return true;
72 }
73
79 return [ 'mediawiki.language.init' ];
80 }
81}
Object passed around to modules which contains information about the state of a specific loader reque...
ResourceLoader module for populating language specific data.
getDependencies(ResourceLoaderContext $context=null)
getData(ResourceLoaderContext $context)
Get all the dynamic data for the content language to an array.
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
static inDebugMode()
Determine whether debug mode was requested Order of priority is 1) request param, 2) cookie,...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2811