r87156 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87155‎ | r87156 | r87157 >
Date:01:28, 30 April 2011
Author:neilk
Status:ok (Comments)
Tags:
Comment:
quick and dirty language stats
Modified paths:
  • /trunk/extensions/UploadWizard/languageStats.php (added) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/languageStats.php
@@ -0,0 +1,25 @@
 2+<?php
 3+
 4+require( 'UploadWizard.i18n.php' );
 5+
 6+$langsToTest = array_slice( $argv, 1 );
 7+
 8+
 9+foreach ( $messages as $lang => $langDict ) {
 10+ if ( count($langsToTest) and (! in_array( $lang, $langsToTest ) ) ) {
 11+ continue;
 12+ }
 13+ $percentComplete[$lang] = 0;
 14+ $total = 0;
 15+ $translated = 0;
 16+ foreach( $messages['en'] as $key => $val ) {
 17+ $total++;
 18+ if ( array_key_exists( $key, $langDict ) ) {
 19+ $translated++;
 20+ }
 21+ }
 22+ $percentage = (int)( 100 * $translated / $total );
 23+ echo "Language: $lang Translated: $translated Percentage: $percentage\n";
 24+
 25+}
 26+
Property changes on: trunk/extensions/UploadWizard/languageStats.php
___________________________________________________________________
Added: svn:eol-style
127 + native
Added: svn:executable
228 + *

Comments

#Comment by 😂 (talk | contribs)   23:38, 3 May 2011

Should remove svn:executable prop.

Status & tagging log