r108830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108829‎ | r108830 | r108831 >
Date:19:46, 13 January 2012
Author:siebrand
Status:ok
Tags:
Comment:
Add switch "--no-fuzzy" to export.php to will filter out fuzzy messages for file based message groups.
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/scripts/export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/export.php
@@ -32,6 +32,7 @@
3333 in that location
3434 --no-location Only used combined with "ppgettext". This option will rebuild
3535 the gettext file without location information.
 36+ --no-fuzzy Do not include any messages marked as fuzzy/outdated.
3637 EOT
3738 );
3839 exit( 1 );
@@ -79,6 +80,12 @@
8081 $noLocation = '';
8182 }
8283
 84+if ( isset( $options['no-fuzzy'] ) ) {
 85+ $noFuzzy = true;
 86+} else {
 87+ $noFuzzy = false;
 88+}
 89+
8390 $reqLangs = Cli::parseLanguageCodes( $options['lang'] );
8491
8592 $groups = array();
@@ -152,6 +159,11 @@
153160 }
154161
155162 $collection->resetForNewLanguage( $lang );
 163+
 164+ if ( $noFuzzy ) {
 165+ $collection->filter( 'fuzzy' );
 166+ }
 167+
156168 $ffs->write( $collection );
157169
158170 // Do post processing if requested.
@@ -172,6 +184,10 @@
173185 }
174186 }
175187 } else {
 188+ if ( $noFuzzy ) {
 189+ STDERR( '--no-fuzzy is not supported for this message group.' );
 190+ }
 191+
176192 $writer = $group->getWriter();
177193 $writer->fileExport( $langs, $options['target'] );
178194 }
Index: trunk/extensions/Translate/README
@@ -30,6 +30,8 @@
3131
3232 == Change log ==
3333 * 2012-01-13
 34+- export.php has a switch "--no-fuzzy" that will filter out fuzzy messages
 35+ for file based message groups.
3436 - Special:PageTranslation has now better error checking for invalid and
3537 duplicate translation unit names.
3638 - Special pages have now help links.

Status & tagging log