MachineTranslationAid.php

Go to the documentation of this file.
00001 <?php
00017 class MachineTranslationAid extends TranslationAid {
00018     public function getData() {
00019         $suggestions = array( '**' => 'suggestion' );
00020 
00021         $translations = $this->getTranslations();
00022         $from = $this->group->getSourceLanguage();
00023         $to = $this->handle->getCode();
00024 
00025         global $wgTranslateTranslationServices;
00026         foreach ( $wgTranslateTranslationServices as $name => $config ) {
00027             if ( $config['type'] === 'ttmserver' ) {
00028                 continue;
00029             }
00030 
00031             $service = TranslationWebService::factory( $name, $config );
00032             if ( !$service ) {
00033                 continue;
00034             }
00035 
00036             $results = $service->getSuggestions( $translations, $from, $to );
00037             $suggestions = array_merge( $suggestions, $results );
00038         }
00039 
00040         return $suggestions;
00041     }
00042 }
Generated on Tue Oct 29 00:00:25 2013 for MediaWiki Translate Extension by  doxygen 1.6.3