class wikiStatsOutput extends statsOutput {
function heading() {
echo "'''Note:''' These statistics can be generated by running <code>php maintenance/transstat.php</code>.\n\n";
+ echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/checkLanguage.php --lang=foo</code>.\n\n";
echo "{| border=2 cellpadding=4 cellspacing=0 style=\"background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;\" width=100%\n";
}
function footer() {
$wgOut->element( 'Language', true );
$wgOut->element( 'Translated', true );
$wgOut->element( '%', true );
-$wgOut->element( 'Same to English', true );
-$wgOut->element( '%', true );
$wgOut->element( 'Obsolete', true );
$wgOut->element( '%', true );
+$wgOut->element( 'Problematic', true );
+$wgOut->element( '%', true );
$wgOut->blockend();
foreach ( $wgLanguages->getList() as $code ) {
$localMessagesNumber = count( $wgLanguages->getMessagesFor( $code ) );
$translatedMessagesNumber = count( $wgLanguages->getTranslatedMessages( $code ) );
$translatedMessagesPercent = $wgOut->formatPercent( $translatedMessagesNumber, $translatableMessagesNumber );
- $duplicateMessagesNumber = count( $wgLanguages->getDuplicateMessages( $code ) );
- $duplicateMessagesPercent = $wgOut->formatPercent( $duplicateMessagesNumber, $translatedMessagesNumber, true );
$obsoleteMessagesNumber = count( $wgLanguages->getObsoleteMessages( $code ) );
$obsoleteMessagesPercent = $wgOut->formatPercent( $obsoleteMessagesNumber, $translatedMessagesNumber, true );
+ $messagesWithoutVariables = $wgLanguages->getMessagesWithoutVariables( $code );
+ $emptyMessages = $wgLanguages->getEmptyMessages( $code );
+ $messagesWithWhitespace = $wgLanguages->getMessagesWithWhitespace( $code );
+ $nonXHTMLMessages = $wgLanguages->getNonXHTMLMessages( $code );
+ $messagesWithWrongChars = $wgLanguages->getMessagesWithWrongChars( $code );
+ $problematicMessagesNumber = count( array_unique( array_merge( $messagesWithoutVariables, $emptyMessages, $messagesWithWhitespace, $nonXHTMLMessages, $messagesWithWrongChars ) ) );
+ $problematicMessagesPercent = $wgOut->formatPercent( $problematicMessagesNumber, $translatedMessagesNumber, true );
# Output them
$wgOut->blockstart();
$wgOut->element( "$name ($code)" );
$wgOut->element( "$translatedMessagesNumber/$translatableMessagesNumber" );
$wgOut->element( $translatedMessagesPercent );
- $wgOut->element( "$duplicateMessagesNumber/$translatedMessagesNumber" );
- $wgOut->element( $duplicateMessagesPercent );
$wgOut->element( "$obsoleteMessagesNumber/$translatedMessagesNumber" );
$wgOut->element( $obsoleteMessagesPercent );
+ $wgOut->element( "$problematicMessagesNumber/$translatedMessagesNumber" );
+ $wgOut->element( $problematicMessagesPercent );
$wgOut->blockend();
}