Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
Hooks | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
onLanguage__getMessagesFileName | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\LandingCheck; |
4 | |
5 | // phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName |
6 | |
7 | use MediaWiki\Languages\Hook\Language__getMessagesFileNameHook; |
8 | |
9 | class Hooks implements Language__getMessagesFileNameHook { |
10 | |
11 | /** |
12 | * Register es-419 as a language supported by this extension but not by |
13 | * MediaWiki core. Handles Language::onGetMessagesFileName hook called in |
14 | * LanguageNameUtils::getMessagesFileName |
15 | * |
16 | * @param string $code language code |
17 | * @param string &$file path of Messages file as found by MediaWiki core |
18 | */ |
19 | public function onLanguage__getMessagesFileName( $code, &$file ) { |
20 | if ( $code === 'es-419' ) { |
21 | $file = dirname( __DIR__ ) . '/messages/MessagesEs_419.php'; |
22 | } |
23 | } |
24 | } |