wfMsgForContentNoTrans() was removed
[mediawiki.git] / includes / resourceloader / ResourceLoaderSpecialCharacterDataModule.php
blob862f62970908329c398f7655bc441d8c51b0444c
1 <?php
2 /**
3 * ResourceLoader module for populating special characters data for some
4 * editing extensions to use.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
21 * @file
24 /**
25 * ResourceLoader module for populating special characters data for some
26 * editing extensions to use.
28 class ResourceLoaderSpecialCharacterDataModule extends ResourceLoaderModule {
29 private $path = "resources/src/mediawiki.language/specialcharacters.json";
30 protected $targets = array( 'desktop', 'mobile' );
32 /**
33 * Get all the dynamic data.
35 * @return array
37 protected function getData() {
38 global $IP;
39 return json_decode( file_get_contents( "$IP/{$this->path}" ) );
42 /**
43 * @param ResourceLoaderContext $context
44 * @return string JavaScript code
46 public function getScript( ResourceLoaderContext $context ) {
47 return Xml::encodeJsCall(
48 'mw.language.setSpecialCharacters',
49 array(
50 $this->getData()
52 ResourceLoader::inDebugMode()
56 /**
57 * @return bool
59 public function enableModuleContentVersion() {
60 return true;
63 /**
64 * @param ResourceLoaderContext $context
65 * @return array
67 public function getDependencies( ResourceLoaderContext $context = null ) {
68 return array( 'mediawiki.language' );
71 /**
72 * @return array
74 public function getMessages() {
75 return array(
76 'special-characters-group-latin',
77 'special-characters-group-latinextended',
78 'special-characters-group-ipa',
79 'special-characters-group-symbols',
80 'special-characters-group-greek',
81 'special-characters-group-cyrillic',
82 'special-characters-group-arabic',
83 'special-characters-group-arabicextended',
84 'special-characters-group-persian',
85 'special-characters-group-hebrew',
86 'special-characters-group-bangla',
87 'special-characters-group-tamil',
88 'special-characters-group-telugu',
89 'special-characters-group-sinhala',
90 'special-characters-group-devanagari',
91 'special-characters-group-gujarati',
92 'special-characters-group-thai',
93 'special-characters-group-lao',
94 'special-characters-group-khmer',
95 'special-characters-title-endash',
96 'special-characters-title-emdash',
97 'special-characters-title-minus'