From: Robin Pepermans Date: Fri, 24 Jun 2011 00:07:57 +0000 (+0000) Subject: localization statistics (transstat.php) now excludes language codes in $wgDummyLangua... X-Git-Tag: 1.31.0-rc.0~29320 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=7a844a686352b87252dd2e38d25947021439c865;p=lhc%2Fweb%2Fwiklou.git localization statistics (transstat.php) now excludes language codes in $wgDummyLanguageCodes (they have always 0%), with a list of them in the description. --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 4625e78100..c0bcc19366 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 diff --git a/maintenance/language/StatOutputs.php b/maintenance/language/StatOutputs.php index f20c2ead47..d994e38a98 100644 --- a/maintenance/language/StatOutputs.php +++ b/maintenance/language/StatOutputs.php @@ -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:''' " . $version . "\n\n"; echo "'''Note:''' These statistics can be generated by running php maintenance/language/transstat.php.\n\n"; echo "For additional information on specific languages (the message names, the actual problems, etc.), run php maintenance/language/checkLanguage.php --lang=foo.\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() { diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php index 45192f08ff..a321326608 100644 --- a/maintenance/language/transstat.php +++ b/maintenance/language/transstat.php @@ -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; }