Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid Class Reference

Translation aid that provides suggestion from translation memory. More...

Inheritance diagram for MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid:
MediaWiki\Extension\Translate\TranslatorInterface\Aid\QueryAggregatorAwareTranslationAid MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid MediaWiki\Extension\Translate\WebService\QueryAggregatorAware

Public Member Functions

 __construct (MessageGroup $group, MessageHandle $handle, IContextSource $context, TranslationAidDataProvider $dataProvider)
 
 populateQueries ()
 
 getData ()
 Translation aid class should implement this function.
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\QueryAggregatorAwareTranslationAid
 setQueryAggregator (QueryAggregator $aggregator)
 

Protected Member Functions

 formatWebSuggestions (array $queryData)
 
 formatInternalSuggestions (array $queryData, ReadableTtmServer $s, string $serviceName, string $sourceLanguage)
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\QueryAggregatorAwareTranslationAid
 storeQuery (TranslationWebService $service, string $from, string $to, string $text)
 Stores a web service query for later execution.
 
 getQueryData ()
 Returns all stored queries.
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid
static getTypes ()
 List of available message types mapped to the classes implementing them.
 
- Protected Attributes inherited from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid
 $group
 
 $handle
 
 $context
 
 $dataProvider
 

Detailed Description

Translation aid that provides suggestion from translation memory.

Author
Niklas Laxström @license GPL-2.0-or-later
Since
2013-01-01 | 2015.02 extends QueryAggregatorAwareTranslationAid

Definition at line 28 of file TTMServerAid.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid::__construct ( MessageGroup $group,
MessageHandle $handle,
IContextSource $context,
TranslationAidDataProvider $dataProvider )

Member Function Documentation

◆ formatInternalSuggestions()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid::formatInternalSuggestions ( array $queryData,
ReadableTtmServer $s,
string $serviceName,
string $sourceLanguage )
protected

Definition at line 130 of file TTMServerAid.php.

◆ formatWebSuggestions()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid::formatWebSuggestions ( array $queryData)
protected

Definition at line 95 of file TTMServerAid.php.

◆ getData()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid::getData ( )

Translation aid class should implement this function.

Return value should be an array with keys and values. Because these are used in the MediaWiki API, lists (numeric keys) should have key '**' set to element name that describes the list values. For example if the translation aid provides translation suggestions, it would return an array which has key '**' set to 'suggestion' and then list of arrays, each containing fields for the information of the suggestions. See InOtherLanguagesAid for example.

Exceptions
TranslationHelperExceptionUsed to signal unexpected errors to aid debugging
Returns
array

Reimplemented from MediaWiki\Extension\Translate\TranslatorInterface\Aid\TranslationAid.

Definition at line 58 of file TTMServerAid.php.

◆ populateQueries()

MediaWiki\Extension\Translate\TranslatorInterface\Aid\TTMServerAid::populateQueries ( )

The documentation for this class was generated from the following file: