r90683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90682‎ | r90683 | r90684 >
Date:00:07, 24 June 2011
Author:robin
Status:ok
Tags:
Comment:
localization statistics (transstat.php) now excludes language codes in $wgDummyLanguageCodes (they have always 0%), with a list of them in the description.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/maintenance/language/StatOutputs.php (modified) (history)
  • /trunk/phase3/maintenance/language/transstat.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/StatOutputs.php
@@ -46,10 +46,19 @@
4747 /** Outputs WikiText */
4848 class wikiStatsOutput extends statsOutput {
4949 function heading() {
 50+ global $wgDummyLanguageCodes, $wgContLang;
5051 $version = SpecialVersion::getVersion( 'nodb' );
5152 echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
5253 echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
5354 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";
 55+ echo 'English (en) is excluded because it is the default localization';
 56+ if( is_array( $wgDummyLanguageCodes ) ) {
 57+ foreach( $wgDummyLanguageCodes as $dummyCode ) {
 58+ $dummyCodes[] = $wgContLang->getLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
 59+ }
 60+ 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 );
 61+ }
 62+ echo ".\n\n"; # dot to end sentence
5463 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";
5564 }
5665 function footer() {
Index: trunk/phase3/maintenance/language/transstat.php
@@ -95,8 +95,9 @@
9696 $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
9797
9898 foreach ( $wgLanguages->getLanguages() as $code ) {
99 - # Don't check English or RTL English
100 - if ( $code == 'en' || $code == 'enRTL' ) {
 99+ # Don't check English, RTL English or dummy language codes
 100+ if ( $code == 'en' || $code == 'enRTL' || (is_array( $wgDummyLanguageCodes ) &&
 101+ in_array( $code, $wgDummyLanguageCodes ) ) ) {
101102 continue;
102103 }
103104
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -56,6 +56,8 @@
5757 * (bug 29397) Implement mw.Title module in core.
5858 * In MySQL 4.1.9+ with replication enabled, get the slave lag from SHOW SLAVE
5959 STATUS instead of SHOW PROCESSLIST.
 60+* Language codes in $wgDummyLanguageCodes are now excluded on localization
 61+ statistics (maintenance/language/transstat.php)
6062
6163 === Bug fixes in 1.19 ===
6264 * (bug 28868) Show total pages in the subtitle of an image on the

Status & tagging log