r37690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37689‎ | r37690 | r37691 >
Date:12:52, 15 July 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* And more fixes
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/TranslateTasks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateTasks.php
@@ -188,36 +188,25 @@
189189 protected function setProcess() {
190190 $this->process = array(
191191 array( $this, 'preinit' ),
 192+ array( $this, 'postinit' ),
192193 array( $this, 'filterNonProblematic' ),
193194 array( $this, 'doPaging' ),
194 - array( $this, 'postinit' ),
195195 );
196196 }
197197
198198 protected function filterNonProblematic() {
199 - $id = $this->group->getId();
200 - $file = TRANSLATE_CHECKFILE . "-$id";
201 - if ( !file_exists($file) ) {
202 - foreach ($this->collection->keys() as $key )
203 - unset( $this->collection[$key] );
204 - return;
205 - }
206 -
207 - $problematic = unserialize( file_get_contents($file) );
208 -
209199 $code = $this->options->getLanguage();
210 - if ( isset($problematic[$code]) ) {
211 - foreach ( $this->collection->keys() as $key ) {
212 - $namespace = $this->group->namespaces[0];
213 - $ikey = strtolower( "$namespace:$key" );
214 - if ( !in_array( $ikey, $problematic[$code] ) ) {
215 - unset( $this->collection[$key] );
216 - }
 200+ $problematic = $this->group->getProblematic( $code );
 201+ $checker = MessageChecks::getInstance();
 202+ $type = $this->group->getType();
 203+
 204+ foreach ( $this->collection->keys() as $key ) {
 205+ $item = $this->collection[$key];
 206+ if ( in_array($key, $problematic) ) {
 207+ if ( $checker->doFastChecks($item, $type, $code) ) continue;
217208 }
218 - } else {
219 - foreach ($this->collection->keys() as $key )
220 - unset( $this->collection[$key] );
221 - return;
 209+
 210+ unset( $this->collection[$key] );
222211 }
223212 }
224213
Index: trunk/extensions/Translate/MessageGroups.php
@@ -31,7 +31,7 @@
3232 public function setIgnored( $value ) { $this->ignored = $value; }
3333
3434 protected $problematic = null;
35 - protected function getProblematic( $code ) {
 35+ public function getProblematic( $code ) {
3636 if ( $this->problematic === null ) {
3737 $this->problematic = array();
3838 $file = TRANSLATE_CHECKFILE . '-' . $this->id;
@@ -45,7 +45,7 @@
4646 return $this->problematic;
4747 }
4848
49 - protected function setProblematic( $value ) { $this->problematic = $value ; }
 49+ public function setProblematic( $value ) { $this->problematic = $value ; }
5050 /**
5151 * Returns a list of optional and ignored messages in 2-d array.
5252 */

Status & tagging log