X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Flanguage%2FStatOutputs.php;h=e9d8c86dd0c5c06cd67defea964ee97fe18fa38f;hb=3b92a39b1671b9b70c0cdd3f4b7aa491b50b6d2c;hp=839d0095c58c3ee8a9b2012738eff0cb274447f1;hpb=062839df85a084feacb0db86efdd1180ef4a8cf4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/language/StatOutputs.php b/maintenance/language/StatOutputs.php index 839d0095c5..e9d8c86dd0 100644 --- a/maintenance/language/StatOutputs.php +++ b/maintenance/language/StatOutputs.php @@ -1,12 +1,29 @@ - * @author Ashar Voultoiz + * @author Antoine Musso */ /** A general output object. Need to be overriden */ @@ -31,11 +48,21 @@ class statsOutput { /** Outputs WikiText */ class wikiStatsOutput extends statsOutput { function heading() { + global $wgDummyLanguageCodes; $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 '{| 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"; + echo 'English (en) is excluded because it is the default localization'; + if ( is_array( $wgDummyLanguageCodes ) ) { + $dummyCodes = array(); + foreach ( $wgDummyLanguageCodes as $dummyCode => $correctCode ) { + $dummyCodes[] = Language::fetchLanguageName( $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" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' . "\n"; } function footer() { echo "|}\n"; @@ -55,7 +82,9 @@ class wikiStatsOutput extends statsOutput { # Weigh reverse with factor 20 so coloring takes effect more quickly as # this option is used solely for reporting 'bad' percentages. $v = $v * 20; - if ( $v > 255 ) $v = 255; + if ( $v > 255 ) { + $v = 255; + } $v = 255 - $v; } if ( $v < 128 ) { @@ -70,8 +99,8 @@ class wikiStatsOutput extends statsOutput { $blue = '00'; $color = $red . $green . $blue; - $percent = statsOutput::formatPercent( $subset, $total, $revert, $accuracy ); - return 'bgcolor="#' . $color . '"|' . $percent; + $percent = parent::formatPercent( $subset, $total, $revert, $accuracy ); + return 'style="background-color:#' . $color . ';"|' . $percent; } }