msg( 'visualeditor-cite-tool-definition.json' ) ->inContentLanguage() ->plain() ); $citationTools = []; if ( is_array( $citationDefinition ) ) { foreach ( $citationDefinition as $tool ) { if ( !isset( $tool->title ) ) { $tool->title = $context->msg( 'visualeditor-cite-tool-name-' . $tool->name ) ->text(); } $citationTools[] = $tool; } } return 've.init.platform.addMessages(' . FormatJson::encode( [ 'visualeditor-cite-tool-definition.json' => json_encode( $citationTools ) ], ResourceLoader::inDebugMode() ) . ');'; } public function getDependencies( ResourceLoaderContext $context = null ) { return [ 'ext.visualEditor.base', 'ext.visualEditor.mediawiki', ]; } public function getDefinitionSummary( ResourceLoaderContext $context ) { $summary = parent::getDefinitionSummary( $context ); $summary[] = [ 'script' => $this->getScript( $context ), ]; return $summary; } }