Update old URLs in DefaultSettings related to Squid caching
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderLanguageDataModule.php
index f718e5f..c0a0921 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for populating language specific data.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -19,7 +17,6 @@
  *
  * @file
  * @author Santhosh Thottingal
- * @author Timo Tijhof
  */
 
 /**
@@ -55,16 +52,11 @@ class ResourceLoaderLanguageDataModule extends ResourceLoaderFileModule {
         * @return string JavaScript code
         */
        public function getScript( ResourceLoaderContext $context ) {
-               $fileScript = parent::getScript( $context );
-               $langDataScript = Xml::encodeJsCall(
-                       'mw.language.setData',
-                       [
-                               $context->getLanguage(),
-                               $this->getData( $context )
-                       ],
-                       ResourceLoader::inDebugMode()
-               );
-               return $fileScript . $langDataScript;
+               return parent::getScript( $context )
+                       . 'mw.language.setData('
+                       . ResourceLoader::encodeJsonForScript( $context->getLanguage() ) . ','
+                       . ResourceLoader::encodeJsonForScript( $this->getData( $context ) )
+                       . ');';
        }
 
        /**