diff options
Diffstat (limited to 'MLEB/Translate/Resources.php')
-rw-r--r-- | MLEB/Translate/Resources.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/MLEB/Translate/Resources.php b/MLEB/Translate/Resources.php index 923b8928..25f45ad7 100644 --- a/MLEB/Translate/Resources.php +++ b/MLEB/Translate/Resources.php @@ -7,7 +7,7 @@ * @license GPL-2.0-or-later */ -global $wgResourceModules; +global $wgResourceModules, $wgVersion; $resourcePaths = [ 'localBasePath' => __DIR__, @@ -61,9 +61,9 @@ $wgResourceModules['ext.translate.editor'] = [ 'jquery.textchange', 'mediawiki.Uri', 'mediawiki.api', - 'mediawiki.api.parse', 'mediawiki.jqueryMsg', 'mediawiki.language', + 'mediawiki.notify', 'mediawiki.user', 'mediawiki.util', ], @@ -119,6 +119,11 @@ $wgResourceModules['ext.translate.editor'] = [ ], ] + $resourcePaths; +if ( version_compare( $wgVersion, '1.32', '<' ) ) { + // Support: MediaWiki 1.31 and earlier + $wgResourceModules['ext.translate.editor']['dependencies'][] = 'mediawiki.api.parse'; +} + $wgResourceModules['ext.translate.groupselector'] = [ 'styles' => 'resources/css/ext.translate.groupselector.less', 'scripts' => 'resources/js/ext.translate.groupselector.js', @@ -276,7 +281,6 @@ $wgResourceModules['ext.translate.special.importtranslations'] = [ $wgResourceModules['ext.translate.special.languagestats'] = [ 'scripts' => 'resources/js/ext.translate.special.languagestats.js', - 'styles' => 'resources/css/ext.translate.special.languagestats.css', 'messages' => [ 'translate-langstats-collapse', 'translate-langstats-collapseall', @@ -301,6 +305,7 @@ $wgResourceModules['ext.translate.special.managetranslatorsandbox'] = [ 'mediawiki.api', 'mediawiki.jqueryMsg', 'mediawiki.language', + 'mediawiki.notify', ], 'messages' => [ 'tsb-accept-all-button-label', @@ -446,7 +451,6 @@ $wgResourceModules['ext.translate.special.translate'] = [ 'jquery.uls.data', 'mediawiki.Uri', 'mediawiki.api', - 'mediawiki.api.parse', 'mediawiki.jqueryMsg', ], 'messages' => [ @@ -459,6 +463,11 @@ $wgResourceModules['ext.translate.special.translate'] = [ ], ] + $resourcePaths; +if ( version_compare( $wgVersion, '1.32', '<' ) ) { + // Support: MediaWiki 1.31 and earlier + $wgResourceModules['ext.translate.special.translate']['dependencies'][] = 'mediawiki.api.parse'; +} + $wgResourceModules['ext.translate.special.translate.styles'] = [ 'styles' => 'resources/css/ext.translate.special.translate.css', ] + $resourcePaths; @@ -495,6 +504,11 @@ $wgResourceModules['ext.translate.statsbar'] = [ ], ] + $resourcePaths; +$wgResourceModules['ext.translate.statstable'] = [ + 'styles' => 'resources/css/ext.translate.statstable.less', + 'targets' => [ 'desktop', 'mobile' ], +] + $resourcePaths; + $wgResourceModules['ext.translate.storage'] = [ 'scripts' => 'resources/js/ext.translate.storage.js', ] + $resourcePaths; |