Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
ScribuntoHookHandler.php
1<?php
2
3namespace MediaWiki\Extension\Translate\MessageBundleTranslation;
4
5use MediaWiki\Extension\Scribunto\Hooks\ScribuntoExternalLibrariesHook;
6
7class ScribuntoHookHandler implements ScribuntoExternalLibrariesHook {
8 public function onScribuntoExternalLibraries( string $engine, array &$extraLibraries ): void {
9 if ( $engine !== 'lua' ) {
10 return;
11 }
12
13 $extraLibraries['mw.ext.translate.messageBundle'] = [
14 'class' => MessageBundleLuaLibrary::class,
15 'deferLoad' => true
16 ];
17 }
18}