(bug 6827) some i18n specific maintenance scripts fails after merge of localisation...
authorRotem Liss <rotem@users.mediawiki.org>
Fri, 4 Aug 2006 20:18:57 +0000 (20:18 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Fri, 4 Aug 2006 20:18:57 +0000 (20:18 +0000)
Because of some changes, it's difficult to know which messages are duplicate and which are not specified, therefore some scripts do not work properly; also, I didn't understand diffLanguage.php, therefore I still didn't fix.

RELEASE-NOTES
maintenance/alltrans.php
maintenance/checktrans.php
maintenance/dumpMessages.php
maintenance/duplicatetrans.php
maintenance/unusedMessages.php

index 86024a9..beb1e99 100644 (file)
@@ -115,6 +115,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6919) Add English alias magic words for Tatar (tt) language file.
 * (bug 6753) Fixed broken Kazakh linktrail (kk)
 * (bug 6700) Added Kazakh language variants to Names.php
+* (bug 6827) some i18n specific maintenance scripts fails after merge of localisation-work branch
 
 == Languages updated ==
 
index 15af0e4..ad41f03 100644 (file)
@@ -8,8 +8,8 @@
 
 require_once( 'commandLine.inc' );
 
-$wgLang = Language::factory( 'en' );
-foreach( array_keys( $wgLang->getAllMessages() ) as $key ) {
+$wgEnglishLang = Language::factory( 'en' );
+foreach( array_keys( $wgEnglishLang->getAllMessages() ) as $key ) {
        echo "$key\n";
 }
 
index ebab4c7..917abf6 100644 (file)
 /** */
 require_once('commandLine.inc');
 
-if ( 'en' == $wgLanguageCode ) {
+die( "This script currently *does not work*, please wait for fix." );
+
+if ( $wgLang->getCode() == 'en' ) {
        print "Current selected language is English. Cannot check translations.\n";
        exit();
 }
 
 $count = $total = 0;
-$msgarray = 'wgAllMessages' . ucfirst( $wgLanguageCode );
+$wgEnglishLang = Language::factory( 'en' );
+$wgEnglishMessages = $wgEnglishLang->getAllMessages();
+$wgLocalMessages = $wgLang->getAllMessages();
 
-foreach ( $wgAllMessagesEn as $code => $msg ) {
+foreach ( $wgEnglishMessages as $code => $msg ) {
        ++$total;
-       if ( ! array_key_exists( $code, $$msgarray ) ) {
+       if ( !isset( $wgLocalMessages[$code] ) ) {
                print "'{$code}' => \"$msg\",\n";
                ++$count;
        }
index 84ecc4c..b31b092 100644 (file)
@@ -9,7 +9,8 @@
 require_once( "commandLine.inc" );
 $wgMessageCache->disableTransform();
 $messages = array();
-foreach ( $wgAllMessagesEn as $key => $englishValue )
+$wgEnglishLang = Language::factory( 'en' );
+foreach ( $wgEnglishLang->getAllMessages() as $key => $englishValue )
 {
        $messages[$key] = wfMsg( $key );
 }
index 89d9cff..89779e8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Prints out messages that are the same as the message with the corrisponding
- * key in the Language.php file
+ * key in the English file
  *
  * @package MediaWiki
  * @subpackage Maintenance
@@ -9,17 +9,21 @@
 
 require_once('commandLine.inc');
 
-if ( 'en' == $wgLanguageCode ) {
+echo "Note: the script also lists the messages which are not defined in this language file, please wait for the bugfix.\n\n";
+
+if ( $wgLang->getCode() == 'en' ) {
        print "Current selected language is English. Cannot check translations.\n";
        exit();
 }
 
 $count = $total = 0;
-$msgarray = 'wgAllMessages' . ucfirst( $wgLanguageCode );
+$wgEnglishLang = Language::factory( 'en' );
+$wgEnglishMessages = $wgEnglishLang->getAllMessages();
+$wgLocalMessages = $wgLang->getAllMessages();
 
-foreach ( $$msgarray as $code => $msg ) {
+foreach ( $wgEnglishMessages as $code => $msg ) {
        ++$total;
-       if ( @$wgAllMessagesEn[$code] == $msg ) {
+       if ( $wgLocalMessages[$code] == $wgEnglishMessages[$code] ) {
                echo "* $code\n";
                ++$count;
        }
index 1cdfcba..351f854 100644 (file)
@@ -8,17 +8,19 @@
 
 require_once('commandLine.inc');
 
-if ( 'en' == $wgLanguageCode ) {
+if ( $wgLang->getCode() == 'en' ) {
        print "Current selected language is English. Cannot check translations.\n";
        exit();
 }
 
 $count = $total = 0;
-$msgarray = 'wgAllMessages' . ucfirst( $wgLanguageCode );
+$wgEnglishLang = Language::factory( 'en' );
+$wgEnglishMessages = $wgEnglishLang->getAllMessages();
+$wgLocalMessages = $wgLang->getAllMessages();
 
-foreach ( $$msgarray as $code => $msg ) {
+foreach ( $wgLocalMessages as $code => $msg ) {
        ++$total;
-       if ( ! array_key_exists( $code, $wgAllMessagesEn ) ) {
+       if ( !isset( $wgEnglishMessages[$code] ) ) {
                print "* $code\n";
                ++$count;
        }