32 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
33 Wikimedia\suppressWarnings();
34 $return = sprintf(
'%.' . $accuracy .
'f%%', 100 * $subset / $total );
35 Wikimedia\restoreWarnings();
52 public function element( $in, $heading =
false ) {
61 echo
"'''Statistics are based on:''' <code>" . $version .
"</code>\n\n";
62 echo
'English (en) is excluded because it is the default localization';
66 $dummyCodes[] = MediaWikiServices::getInstance()
67 ->getLanguageNameUtils()
68 ->getLanguageName( $dummyCode ) .
' (' . $dummyCode .
')';
70 echo
', as well as the following languages that are not intended for ' .
71 'system message translations, usually because they redirect to other ' .
72 'language codes: ' . implode(
', ', $dummyCodes );
76 echo
'{| class="sortable wikitable" border="2" style="background-color: #F9F9F9; ' .
77 'border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' .
"\n";
92 public function element( $in, $heading =
false ) {
93 echo ( $heading ?
'!' :
'|' ) .
"$in\n";
96 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
97 Wikimedia\suppressWarnings();
98 $v = round( 255 * $subset / $total );
99 Wikimedia\restoreWarnings();
102 # Weigh reverse with factor 20 so coloring takes effect more quickly as
103 # this option is used solely for reporting 'bad' percentages.
113 $green = sprintf(
'%02X', 2 * $v );
116 $red = sprintf(
'%02X', 2 * ( 255 - $v ) );
120 $color = $red . $green . $blue;
122 $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
124 return 'style="background-color:#' . $color .
';"|' . $percent;
130 public function element( $in, $heading =
false ) {
141 public function element( $in, $heading =
false ) {
$wgDummyLanguageCodes
Functionally the same as $wgExtraLanguageCodes, but deprecated.
element( $in, $heading=false)
static getVersion( $flags='', $lang=null)
Return a string of the MediaWiki version with Git revision if available.
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)