Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -284,25 +284,18 @@ |
285 | 285 | |
286 | 286 | foreach ( $this->collection->getMessageKeys() as $key ) { |
287 | 287 | // Allow up to 10 seconds to search for suggestions. |
288 | | - if ( time() - $start > 10 || TranslationHelpers::checkTranslationServiceFailure( 'tmserver' ) ) { |
| 288 | + if ( time() - $start > 10 ) { |
289 | 289 | unset( $this->collection[$key] ); |
290 | 290 | continue; |
291 | 291 | } |
292 | 292 | |
293 | | - $def = rawurlencode( $this->collection[$key]->definition() ); |
294 | | - $url = "$server:$port/tmserver/$sourceLanguage/$code/unit/$def"; |
295 | | - $suggestions = Http::get( $url, $timeout ); |
296 | | - |
297 | | - if ( $suggestions !== false ) { |
298 | | - $suggestions = FormatJson::decode( $suggestions, true ); |
299 | | - foreach ( $suggestions as $s ) { |
300 | | - // We have a good suggestion, do not filter. |
301 | | - if ( $s['quality'] > 0.80 ) { |
302 | | - continue 2; |
303 | | - } |
| 293 | + $definition = $this->collection[$key]->definition(); |
| 294 | + $suggestions = TTMServer::primary()->query( $sourceLanguage, $code, $definition ); |
| 295 | + foreach ( $suggestions as $s ) { |
| 296 | + // We have a good suggestion, do not filter. |
| 297 | + if ( $s['quality'] > 0.80 ) { |
| 298 | + continue 2; |
304 | 299 | } |
305 | | - } else { |
306 | | - TranslationHelpers::reportTranslationServiceFailure( 'tmserver' ); |
307 | 300 | } |
308 | 301 | unset( $this->collection[$key] ); |
309 | 302 | } |