Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
TranslateExt | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
getConfig | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace MediaWiki\Extension\Translate\PageTranslation; |
5 | |
6 | use Wikimedia\Parsoid\Ext\ExtensionModule; |
7 | |
8 | class TranslateExt implements ExtensionModule { |
9 | |
10 | /** @inheritDoc */ |
11 | public function getConfig(): array { |
12 | if ( version_compare( MW_VERSION, '1.41', '<' ) ) { |
13 | // Before MW 1.41 Wikimedia\Parsoid\Config\SiteConfig::processExtensionModule expected annotations |
14 | // to be an array of strings. This was updated in I4e9a7a8bec3cb9532ef8a729fd2c6c4acca5d8a0 |
15 | return [ |
16 | 'name' => 'Translate', |
17 | 'annotations' => [ 'translate', 'tvar' ] |
18 | ]; |
19 | } else { |
20 | return [ |
21 | 'name' => 'Translate', |
22 | 'annotations' => [ |
23 | 'tagNames' => [ 'translate', 'tvar' ], |
24 | 'annotationStripper' => |
25 | [ |
26 | 'class' => TranslateAnnotationStripper::class, |
27 | 'services' => [ 'Translate:TranslatablePageParser' ] |
28 | ], |
29 | ], |
30 | ]; |
31 | } |
32 | } |
33 | } |