MediaWiki REL1_30
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 'grammarForms' => $language->getGrammarForms(),
44 'grammarTransformations' => $language->getGrammarTransformations(),
45 'pluralRules' => $language->getPluralRules(),
46 'digitGroupingPattern' => $language->digitGroupingPattern(),
47 'fallbackLanguages' => $language->getFallbackLanguages(),
48 ];
49 }
50
56 return Xml::encodeJsCall(
57 'mw.language.setData',
58 [
59 $context->getLanguage(),
60 $this->getData( $context )
61 ],
63 );
64 }
65
69 public function enableModuleContentVersion() {
70 return true;
71 }
72
78 return [ 'mediawiki.language.init' ];
79 }
80}
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:2780