http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66843

Revision: 66843
Author:   dale
Date:     2010-05-24 18:57:28 +0000 (Mon, 24 May 2010)

Log Message:
-----------
fixed bug in stand alone message loading 

Modified Paths:
--------------
    branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php
    branches/MwEmbedStandAlone/jsScriptLoader.php
    branches/MwEmbedStandAlone/languages/mw.Language.js

Modified: branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php
===================================================================
--- branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php   2010-05-24 
18:36:06 UTC (rev 66842)
+++ branches/MwEmbedStandAlone/includes/noMediaWikiConfig.php   2010-05-24 
18:57:28 UTC (rev 66843)
@@ -148,7 +148,7 @@
                if( !is_file( $msgFile ) ) {
                        throw new MWException( "Missing msgFile: " . 
htmlspecialchars( $msgFile ) . "\n" );
                }
-               require_once( $msgFile );
+               require( $msgFile );
                // Save some time by only including the current language in the 
cache:
                if( isset( $messages[ $langKey ] ) ) {
                        $wgMessageCache = array_merge( $wgMessageCache, 
$messages[ $langKey ] );

Modified: branches/MwEmbedStandAlone/jsScriptLoader.php
===================================================================
--- branches/MwEmbedStandAlone/jsScriptLoader.php       2010-05-24 18:36:06 UTC 
(rev 66842)
+++ branches/MwEmbedStandAlone/jsScriptLoader.php       2010-05-24 18:57:28 UTC 
(rev 66843)
@@ -131,7 +131,7 @@
 
                                // Output the loaders js
                                $loaderJS = 
jsClassLoader::getCombinedLoaderJs();
-                               // Transform the loader text to remove debug 
statments and
+                               // Transform the loader text to remove debug 
statements and
                                // update language msgs if any are present
                                $this->output .= $this->transformScriptText( 
$loaderJS , 'mwEmbed');
 
@@ -789,6 +789,7 @@
        /*
         * Transform script text with language key substitution
         * and clear out debug lines if present.
+        * @param {String} $scriptText Text string to be transformed
         */
        function transformScriptText( $scriptText , $moduleName){
                global $wgEnableScriptLocalization;
@@ -801,7 +802,6 @@
                if ( $wgEnableScriptLocalization ){
                        // Get the mw.addMessage javascript from scriptText and 
moduleName
                        $addMessageJs  = $this->getAddMessagesFromScriptText( & 
$scriptText , $moduleName);
-
                        //@@NOTE getAddMessagesFromClass could identify which 
mode we are in and we would not need to
                        // try each of these search patterns in the same order 
as before.
 
@@ -1033,7 +1033,7 @@
         * @param {Array} $jmsg Associative array of message key -> message 
value pairs
         * @param {String} $langCode Language code override
         */
-       static public function updateMessageValues(& $messegeArray, $langCode = 
false){
+       static public function updateMessageValues( & $messegeArray, $langCode 
= false ){
                global $wgLang;
                // Check the langCode
                if(!$langCode && $wgLang) {

Modified: branches/MwEmbedStandAlone/languages/mw.Language.js
===================================================================
--- branches/MwEmbedStandAlone/languages/mw.Language.js 2010-05-24 18:36:06 UTC 
(rev 66842)
+++ branches/MwEmbedStandAlone/languages/mw.Language.js 2010-05-24 18:57:28 UTC 
(rev 66843)
@@ -187,7 +187,10 @@
                * @param {Array} args  An array of string or jquery objects to 
be swapped in
                * @return string
                */
-               replaceStringArgs : function() {                                
+               replaceStringArgs : function() {
+                       if( ! this.arguments ) { 
+                               return ;                        
+                       }       
                        // Replace Values
                        for ( var v = 0; v < this.arguments.length; v++ ) {     
                        
                                if( typeof this.arguments[v] == 'undefined' ) {



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to