r107807 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107806‎ | r107807 | r107808 >
Date:09:05, 2 January 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Trying to fix broken export.php
Modified paths:
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -113,15 +113,19 @@
114114
115115 STDERR( 'Exporting ' . $groupId );
116116
 117+ $langs = $reqLangs;
117118 if ( $threshold ) {
118 - $langs = TranslationStats::getPercentageTranslated(
119 - $groupId,
120 - $reqLangs,
121 - $threshold,
122 - true
123 - );
124 - } else {
125 - $langs = $reqLangs;
 119+ $stats = MessageGroupStats::forGroup( $groupId );
 120+ foreach ( $langs as $index => $code ) {
 121+ if ( !isset( $stats[$code] ) ) {
 122+ unset( $langs[$index] );
 123+ }
 124+
 125+ list( $total, $translated, ) = $stats[$code];
 126+ if ( $translate/$total < $threshold ) {
 127+ unset( $langs[$index] );
 128+ }
 129+ }
126130 }
127131
128132 if ( $group instanceof FileBasedMessageGroup ) {

Status & tagging log