From: Rotem Liss Date: Sun, 20 Aug 2006 11:57:30 +0000 (+0000) Subject: Showing statistics about problematic messages, instead of duplicate messages - it... X-Git-Tag: 1.31.0-rc.0~55939 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=d9a0844ff816de3723b0127d7d778e7c60639519;p=lhc%2Fweb%2Fwiklou.git Showing statistics about problematic messages, instead of duplicate messages - it's more useful, as the duplicate messages may only indicate a problem, while the problematic messages are actual problems. --- diff --git a/maintenance/transstat.php b/maintenance/transstat.php index abf8644a52..7f0a6fd124 100644 --- a/maintenance/transstat.php +++ b/maintenance/transstat.php @@ -61,6 +61,7 @@ class statsOutput { class wikiStatsOutput extends statsOutput { function heading() { echo "'''Note:''' These statistics can be generated by running php maintenance/transstat.php.\n\n"; + echo "For additional information on specific languages (the message names, the actual problems, etc.), run php maintenance/checkLanguage.php --lang=foo.\n\n"; echo "{| border=2 cellpadding=4 cellspacing=0 style=\"background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;\" width=100%\n"; } function footer() { @@ -141,10 +142,10 @@ $wgOut->blockstart(); $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 ) { @@ -159,20 +160,25 @@ 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(); }