RemoteTTMServerWebService Class Reference
[Translation Web Services]

Implements support for ttmserver via MediaWiki API. More...

Inheritance diagram for RemoteTTMServerWebService:
Inheritance graph
[legend]
Collaboration diagram for RemoteTTMServerWebService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 getSuggestions ($translations, $from, $to)
 Do the only supported thing for web services: get a suggestion for translation.

Protected Member Functions

 mapCode ($code)
 Map a MediaWiki (almost standard) language code to the code used by the translation service.
 doPairs ()
 Get the list of supported language pairs for the web service.
 doRequest ($text, $from, $to)
 Get the suggestion.

Detailed Description

Implements support for ttmserver via MediaWiki API.

See also:
https://www.mediawiki.org/wiki/Help:Extension:Translate/Translation_memories
Since:
2013-01-01

Definition at line 17 of file RemoteTTMServerWebService.php.


Member Function Documentation

RemoteTTMServerWebService::doPairs (  )  [protected]

Get the list of supported language pairs for the web service.

The codes should be the ones used by the service. Caching is handled by the public getSupportedLanguagePairs.

Returns:
array $list[source language][target language] = true

Reimplemented from TranslationWebService.

Definition at line 38 of file RemoteTTMServerWebService.php.

RemoteTTMServerWebService::doRequest ( text,
from,
to 
) [protected]

Get the suggestion.

See getSuggestions for the public method.

Parameters:
string $text Text to translate.
string $from Language code of the text, as used by the service.
string $to Language code of the translation, as used by the service.
Returns:
string Translation suggestion.

Reimplemented from TranslationWebService.

Definition at line 42 of file RemoteTTMServerWebService.php.

Referenced by getSuggestions().

Here is the call graph for this function:

RemoteTTMServerWebService::getSuggestions ( translations,
sourceLanguage,
targetLanguage 
)

Do the only supported thing for web services: get a suggestion for translation.

Prefers source language as input for suggestions.

Parameters:
array $translations List of all translations listed by language code.
string $sourceLanguage Language code as used by MediaWiki.
string $targetLanguage Language code as used by MediaWiki.
Returns:
array[] The returned suggestion arrays contain the following keys:
  • value: the suggestion
  • language: the language of the suggestion (=$targetLanguage)
  • source_text: the text used as input for the web service
  • source_language: the language of the text used as input
  • service: name of the web service

Reimplemented from TranslationWebService.

Definition at line 18 of file RemoteTTMServerWebService.php.

Here is the call graph for this function:

RemoteTTMServerWebService::mapCode ( code  )  [protected]

Map a MediaWiki (almost standard) language code to the code used by the translation service.

Parameters:
string $code MediaWiki language code.
Returns:
string Translation service language code.

Reimplemented from TranslationWebService.

Definition at line 34 of file RemoteTTMServerWebService.php.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:52 2013 for MediaWiki Translate Extension by  doxygen 1.6.3