X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/resourceloader/ResourceLoaderSpecialCharacterDataModule.php diff --git a/includes/resourceloader/ResourceLoaderSpecialCharacterDataModule.php b/includes/resourceloader/ResourceLoaderSpecialCharacterDataModule.php new file mode 100644 index 00000000..a0061e35 --- /dev/null +++ b/includes/resourceloader/ResourceLoaderSpecialCharacterDataModule.php @@ -0,0 +1,102 @@ +path}" ) ); + } + + /** + * @param ResourceLoaderContext $context + * @return string JavaScript code + */ + public function getScript( ResourceLoaderContext $context ) { + return Xml::encodeJsCall( + 'mw.language.setSpecialCharacters', + [ + $this->getData() + ], + ResourceLoader::inDebugMode() + ); + } + + /** + * @return bool + */ + public function enableModuleContentVersion() { + return true; + } + + /** + * @param ResourceLoaderContext $context + * @return array + */ + public function getDependencies( ResourceLoaderContext $context = null ) { + return [ 'mediawiki.language' ]; + } + + /** + * @return array + */ + public function getMessages() { + return [ + 'special-characters-group-latin', + 'special-characters-group-latinextended', + 'special-characters-group-ipa', + 'special-characters-group-symbols', + 'special-characters-group-greek', + 'special-characters-group-greekextended', + 'special-characters-group-cyrillic', + 'special-characters-group-arabic', + 'special-characters-group-arabicextended', + 'special-characters-group-persian', + 'special-characters-group-hebrew', + 'special-characters-group-bangla', + 'special-characters-group-tamil', + 'special-characters-group-telugu', + 'special-characters-group-sinhala', + 'special-characters-group-devanagari', + 'special-characters-group-gujarati', + 'special-characters-group-thai', + 'special-characters-group-lao', + 'special-characters-group-khmer', + 'special-characters-group-canadianaboriginal', + 'special-characters-title-endash', + 'special-characters-title-emdash', + 'special-characters-title-minus' + ]; + } +}