2012-06-21 20:39:27 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Resource loader module for certain VisualEditor messages.
|
|
|
|
*
|
|
|
|
* @file
|
2012-07-19 00:11:26 +00:00
|
|
|
* @ingroup Extensions
|
|
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
2012-06-21 20:39:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Module for user preference customizations
|
|
|
|
*/
|
|
|
|
class VisualEditorMessagesModule extends ResourceLoaderModule {
|
|
|
|
|
|
|
|
/* Protected Members */
|
|
|
|
|
|
|
|
protected $modifiedTime = array();
|
|
|
|
|
|
|
|
protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
|
|
|
|
|
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
public function getScript( ResourceLoaderContext $context ) {
|
|
|
|
$messages = array(
|
2012-06-26 00:32:33 +00:00
|
|
|
'summary' => wfMessage( 'summary' )->parse(),
|
|
|
|
'minoredit' => wfMessage( 'minoredit' )->parse(),
|
|
|
|
'watchthis' => wfMessage( 'watchthis' )->parse(),
|
2012-06-21 20:39:27 +00:00
|
|
|
);
|
2012-07-20 23:59:59 +00:00
|
|
|
return 've.init.platform.addMessages(' . FormatJson::encode( $messages ) . ');';
|
2012-06-21 20:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getMessages() {
|
|
|
|
// We don't actually use the i18n on the client-side, but registering the messages
|
|
|
|
// is needed to make cache invalidation work
|
2012-06-26 00:32:33 +00:00
|
|
|
return array( 'summary', 'minoredit', 'watchthis' );
|
2012-06-21 20:39:27 +00:00
|
|
|
}
|
2012-07-20 23:59:59 +00:00
|
|
|
|
2012-06-21 20:39:27 +00:00
|
|
|
public function getDependencies() {
|
|
|
|
return array( 'ext.visualEditor.base' );
|
|
|
|
}
|
|
|
|
}
|