* removed <JAVASCRIPT EN REPLACE> in favor of normal $messages['en'] check
authorMichael Dale <dale@users.mediawiki.org>
Tue, 18 Aug 2009 21:44:37 +0000 (21:44 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Tue, 18 Aug 2009 21:44:37 +0000 (21:44 +0000)
* updated maintenance script accordingly

js2/mwEmbed/php/languages/mwEmbed.i18n.php
js2/mwEmbed/php/maintenance/mergeJavascriptMsg.php

index 436e707..e31ba4a 100644 (file)
@@ -7,7 +7,6 @@
  * the following English language portion is automatically merged via the maintenance script.
  */
 
-#<JAVASCRIPT EN REPLACE>
 $messages['en'] = array(
        /*
        * js file: /libTimedText/mvTextInterface.js
@@ -258,5 +257,4 @@ $messages['en'] = array(
        'size-megabytes' => '$1 MB',
        'size-kilobytes' => '$1 K',
        'size-bytes' => '$1 B',
-);
-#</JAVASCRIPT EN REPLACE>
\ No newline at end of file
+);
\ No newline at end of file
index 8a80730..66268f2 100644 (file)
@@ -15,8 +15,9 @@ define( 'MEDIAWIKI', true );
 // get the scriptLoader globals:
 require_once('../../jsScriptLoader.php');
 
-$mwSTART_MSG_KEY = '#<JAVASCRIPT EN REPLACE>';
-$mwEND_MSG_KEY = '#</JAVASCRIPT EN REPLACE>';
+$mwSTART_MSG_KEY = '$messages[\'en\'] = array(';
+$mwEND_MSG_KEY = ',
+);';
 $mwLangFilePath = '../languages/mwEmbed.i18n.php';
 // get options (like override JS or override PHP)
 
@@ -24,7 +25,7 @@ $mwLangFilePath = '../languages/mwEmbed.i18n.php';
 $rawLangFile = file_get_contents( $mwLangFilePath );
 
 $startInx = strpos( $rawLangFile, $mwSTART_MSG_KEY) + strlen( $mwSTART_MSG_KEY );
-$endInx = strpos( $rawLangFile, $mwEND_MSG_KEY );
+$endInx = strpos( $rawLangFile, $mwEND_MSG_KEY ) +1;
 if( $startInx === false || $endInx === false ){
     print "Could not find $mwSTART_MSG_KEY or $mwEND_MSG_KEY in mwEmbed.i18n.php \n";
        exit();
@@ -39,7 +40,7 @@ $path = realpath('../../');
 
 $curFileName = '';
 // @@todo existing msgSet should be parsed (or we just "include" the file first)
-$msgSet = '$messages[\'en\'] = array(';
+$msgSet = "";
 
 $objects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $path ), RecursiveIteratorIterator::SELF_FIRST );
 foreach( $objects as $fname => $object){
@@ -54,8 +55,12 @@ foreach( $objects as $fname => $object){
                }
        }
 }
-// close up the msgSet:
-$msgSet.= ");\n";
+// rebuild and output to file
+if( file_put_contents( $mwLangFilePath, trim( $preFile ) . "\n\t" . trim( $msgSet ) . "\n" . trim( $postFile ) ) ){
+    print "updated $mwLangFilePath file\n";
+    exit();
+}
+
 
 function doJsonMerge( $json_txt ){
     global $curFileName;
@@ -73,10 +78,4 @@ function doJsonMerge( $json_txt ){
         print "could not get any json vars from:$curFileName \n";
         return '';
     }
-}
-
-// rebuild and output to file
-if( file_put_contents( $mwLangFilePath, trim( $preFile ) . "\n" . trim( $msgSet ) . "\n" . trim( $postFile ) ) ){
-    print "updated $mwLangFilePath file\n";
-    exit();
 }
\ No newline at end of file