localization statistics (transstat.php) now excludes language codes in $wgDummyLangua...
authorRobin Pepermans <robin@users.mediawiki.org>
Fri, 24 Jun 2011 00:07:57 +0000 (00:07 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Fri, 24 Jun 2011 00:07:57 +0000 (00:07 +0000)
RELEASE-NOTES-1.19
maintenance/language/StatOutputs.php
maintenance/language/transstat.php

index 4625e78..c0bcc19 100644 (file)
@@ -56,6 +56,8 @@ production.
 * (bug 29397) Implement mw.Title module in core.
 * In MySQL 4.1.9+ with replication enabled, get the slave lag from SHOW SLAVE 
   STATUS instead of SHOW PROCESSLIST.
+* Language codes in $wgDummyLanguageCodes are now excluded on localization
+  statistics (maintenance/language/transstat.php)
 
 === Bug fixes in 1.19 ===
 * (bug 28868) Show total pages in the subtitle of an image on the
index f20c2ea..d994e38 100644 (file)
@@ -46,10 +46,19 @@ class statsOutput {
 /** Outputs WikiText */
 class wikiStatsOutput extends statsOutput {
        function heading() {
+               global $wgDummyLanguageCodes, $wgContLang;
                $version = SpecialVersion::getVersion( 'nodb' );
                echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
                echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
                echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
+               echo 'English (en) is excluded because it is the default localization';
+               if( is_array( $wgDummyLanguageCodes ) ) {
+                       foreach( $wgDummyLanguageCodes as $dummyCode ) {
+                               $dummyCodes[] = $wgContLang->getLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
+                       }
+                       echo ', as well as the following languages that are not intended for system message translations, usually because they redirect to other language codes: ' . implode( ', ', $dummyCodes );
+               }
+               echo ".\n\n"; # dot to end sentence
                echo '{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;" width="100%"' . "\n";
        }
        function footer() {
index 45192f0..a321326 100644 (file)
@@ -95,8 +95,9 @@ $wgGeneralMessages = $wgLanguages->getGeneralMessages();
 $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
 
 foreach ( $wgLanguages->getLanguages() as $code ) {
-       # Don't check English or RTL English
-       if ( $code == 'en' || $code == 'enRTL' ) {
+       # Don't check English, RTL English or dummy language codes
+       if ( $code == 'en' || $code == 'enRTL' || (is_array( $wgDummyLanguageCodes ) &&
+               in_array( $code, $wgDummyLanguageCodes ) ) ) {
                continue;
        }