* @throws MWException if there is a syntax error in the JSON file
* @return array with a 'messages' key, or empty array if the file doesn't exist
*/
- protected function readJSONFile( $fileName ) {
+ public function readJSONFile( $fileName ) {
wfProfileIn( __METHOD__ );
if ( !is_readable( $fileName ) ) {
$this->mNamespaceAliases[$code] = array();
$this->mMagicWords[$code] = array();
$this->mSpecialPageAliases[$code] = array();
+
+ $jsonfilename = Language::getJsonMessagesFileName( $code );
+ if ( file_exists( $jsonfilename ) ) {
+ $json = Language::getLocalisationCache()->readJSONFile( $jsonfilename );
+ $this->mRawMessages[$code] = $json['messages'];
+ }
+
$filename = Language::getMessagesFileName( $code );
if ( file_exists( $filename ) ) {
require $filename;
- if ( isset( $messages ) ) {
- $this->mRawMessages[$code] = $messages;
- }
if ( isset( $fallback ) ) {
$this->mFallback[$code] = $fallback;
}