25 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
27 $return = @sprintf(
'%.' . $accuracy .
'f%%', 100 * $subset / $total );
48 public function element( $in, $heading =
false ) {
56 $version = SpecialVersion::getVersion(
'nodb' );
57 echo
"'''Statistics are based on:''' <code>" . $version .
"</code>\n\n";
58 echo
'English (en) is excluded because it is the default localization';
62 $dummyCodes[] = $this->getServiceContainer()
63 ->getLanguageNameUtils()
64 ->getLanguageName( $dummyCode ) .
' (' . $dummyCode .
')';
66 echo
', as well as the following languages that are not intended for ' .
67 'system message translations, usually because they redirect to other ' .
68 'language codes: ' . implode(
', ', $dummyCodes );
72 echo
'{| class="sortable wikitable" border="2" style="background-color: #F9F9F9; ' .
73 'border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' .
"\n";
89 public function element( $in, $heading =
false ) {
90 echo ( $heading ?
'!' :
'|' ) .
"$in\n";
94 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
96 $v = @round( 255 * $subset / $total );
99 # Weigh reverse with factor 20 so coloring takes effect more quickly as
100 # this option is used solely for reporting 'bad' percentages.
110 $green = sprintf(
'%02X', 2 * $v );
113 $red = sprintf(
'%02X', 2 * ( 255 - $v ) );
117 $color = $red . $green . $blue;
119 $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
121 return 'style="background-color:#' . $color .
';"|' . $percent;
128 public function element( $in, $heading =
false ) {
140 public function element( $in, $heading =
false ) {
element( $in, $heading=false)
formatPercent( $subset, $total, $revert=false, $accuracy=2)
element( $in, $heading=false)
element( $in, $heading=false)
element( $in, $heading=false)
formatPercent( $subset, $total, $revert=false, $accuracy=2)
string
$wgDummyLanguageCodes
Config variable stub for the DummyLanguageCodes setting, for use by phpdoc and IDEs.