Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -188,36 +188,25 @@ |
189 | 189 | protected function setProcess() { |
190 | 190 | $this->process = array( |
191 | 191 | array( $this, 'preinit' ), |
| 192 | + array( $this, 'postinit' ), |
192 | 193 | array( $this, 'filterNonProblematic' ), |
193 | 194 | array( $this, 'doPaging' ), |
194 | | - array( $this, 'postinit' ), |
195 | 195 | ); |
196 | 196 | } |
197 | 197 | |
198 | 198 | 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 | | - |
209 | 199 | $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; |
217 | 208 | } |
218 | | - } else { |
219 | | - foreach ($this->collection->keys() as $key ) |
220 | | - unset( $this->collection[$key] ); |
221 | | - return; |
| 209 | + |
| 210 | + unset( $this->collection[$key] ); |
222 | 211 | } |
223 | 212 | } |
224 | 213 | |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | public function setIgnored( $value ) { $this->ignored = $value; } |
33 | 33 | |
34 | 34 | protected $problematic = null; |
35 | | - protected function getProblematic( $code ) { |
| 35 | + public function getProblematic( $code ) { |
36 | 36 | if ( $this->problematic === null ) { |
37 | 37 | $this->problematic = array(); |
38 | 38 | $file = TRANSLATE_CHECKFILE . '-' . $this->id; |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | return $this->problematic; |
47 | 47 | } |
48 | 48 | |
49 | | - protected function setProblematic( $value ) { $this->problematic = $value ; } |
| 49 | + public function setProblematic( $value ) { $this->problematic = $value ; } |
50 | 50 | /** |
51 | 51 | * Returns a list of optional and ignored messages in 2-d array. |
52 | 52 | */ |