diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/language/transstat.php | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/language/transstat.php')
-rw-r--r-- | maintenance/language/transstat.php | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php index 61b84a07..4a853b0f 100644 --- a/maintenance/language/transstat.php +++ b/maintenance/language/transstat.php @@ -24,7 +24,7 @@ * @author Antoine Musso <hashar at free dot fr> * * Output is posted from time to time on: - * http://www.mediawiki.org/wiki/Localisation_statistics + * https://www.mediawiki.org/wiki/Localisation_statistics */ $optionsWithArgs = array( 'output' ); @@ -32,7 +32,6 @@ require_once __DIR__ . '/../commandLine.inc'; require_once 'languages.inc'; require_once __DIR__ . '/StatOutputs.php'; - if ( isset( $options['help'] ) ) { showUsage(); } @@ -57,25 +56,23 @@ TEXT; exit( 1 ); } - - # Select an output engine switch ( $options['output'] ) { case 'wiki': - $output = new wikiStatsOutput(); + $output = new WikiStatsOutput(); break; case 'text': - $output = new textStatsOutput(); + $output = new TextStatsOutput(); break; case 'csv': - $output = new csvStatsOutput(); + $output = new CsvStatsOutput(); break; default: showUsage(); } # Languages -$wgLanguages = new languages(); +$wgLanguages = new Languages(); # Header $output->heading(); @@ -97,7 +94,8 @@ $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] ); foreach ( $wgLanguages->getLanguages() as $code ) { # Don't check English, RTL English or dummy language codes if ( $code == 'en' || $code == 'enRTL' || ( is_array( $wgDummyLanguageCodes ) && - isset( $wgDummyLanguageCodes[$code] ) ) ) { + isset( $wgDummyLanguageCodes[$code] ) ) + ) { continue; } @@ -107,16 +105,33 @@ foreach ( $wgLanguages->getLanguages() as $code ) { $messages = $wgLanguages->getMessages( $code ); $messagesNumber = count( $messages['translated'] ); $requiredMessagesNumber = count( $messages['required'] ); - $requiredMessagesPercent = $output->formatPercent( $requiredMessagesNumber, $wgRequiredMessagesNumber ); + $requiredMessagesPercent = $output->formatPercent( + $requiredMessagesNumber, + $wgRequiredMessagesNumber + ); $obsoleteMessagesNumber = count( $messages['obsolete'] ); - $obsoleteMessagesPercent = $output->formatPercent( $obsoleteMessagesNumber, $messagesNumber, true ); + $obsoleteMessagesPercent = $output->formatPercent( + $obsoleteMessagesNumber, + $messagesNumber, + true + ); $messagesWithMismatchVariables = $wgLanguages->getMessagesWithMismatchVariables( $code ); $emptyMessages = $wgLanguages->getEmptyMessages( $code ); $messagesWithWhitespace = $wgLanguages->getMessagesWithWhitespace( $code ); $nonXHTMLMessages = $wgLanguages->getNonXHTMLMessages( $code ); $messagesWithWrongChars = $wgLanguages->getMessagesWithWrongChars( $code ); - $problematicMessagesNumber = count( array_unique( array_merge( $messagesWithMismatchVariables, $emptyMessages, $messagesWithWhitespace, $nonXHTMLMessages, $messagesWithWrongChars ) ) ); - $problematicMessagesPercent = $output->formatPercent( $problematicMessagesNumber, $messagesNumber, true ); + $problematicMessagesNumber = count( array_unique( array_merge( + $messagesWithMismatchVariables, + $emptyMessages, + $messagesWithWhitespace, + $nonXHTMLMessages, + $messagesWithWrongChars + ) ) ); + $problematicMessagesPercent = $output->formatPercent( + $problematicMessagesNumber, + $messagesNumber, + true + ); # Output them $output->blockstart(); |