27use Wikimedia\AtEase\AtEase;
33 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
34 AtEase::suppressWarnings();
35 $return = sprintf(
'%.' . $accuracy .
'f%%', 100 * $subset / $total );
36 AtEase::restoreWarnings();
53 public function element( $in, $heading =
false ) {
61 $version = SpecialVersion::getVersion(
'nodb' );
62 echo
"'''Statistics are based on:''' <code>" . $version .
"</code>\n\n";
63 echo
'English (en) is excluded because it is the default localization';
67 $dummyCodes[] = $this->getServiceContainer()
68 ->getLanguageNameUtils()
69 ->getLanguageName( $dummyCode ) .
' (' . $dummyCode .
')';
71 echo
', as well as the following languages that are not intended for ' .
72 'system message translations, usually because they redirect to other ' .
73 'language codes: ' . implode(
', ', $dummyCodes );
77 echo
'{| class="sortable wikitable" border="2" style="background-color: #F9F9F9; ' .
78 'border: 1px #AAAAAA solid; border-collapse: collapse; clear:both; width:100%;"' .
"\n";
93 public function element( $in, $heading =
false ) {
94 echo ( $heading ?
'!' :
'|' ) .
"$in\n";
97 public function formatPercent( $subset, $total, $revert =
false, $accuracy = 2 ) {
98 AtEase::suppressWarnings();
99 $v = round( 255 * $subset / $total );
100 AtEase::restoreWarnings();
103 # Weigh reverse with factor 20 so coloring takes effect more quickly as
104 # this option is used solely for reporting 'bad' percentages.
114 $green = sprintf(
'%02X', 2 * $v );
117 $red = sprintf(
'%02X', 2 * ( 255 - $v ) );
121 $color = $red . $green . $blue;
123 $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
125 return 'style="background-color:#' . $color .
';"|' . $percent;
131 public function element( $in, $heading =
false ) {
142 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)
$wgDummyLanguageCodes
Config variable stub for the DummyLanguageCodes setting, for use by phpdoc and IDEs.