Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\WebService\MintCxserverWebService Class Reference

Implements support for MinT translation service via the Cxserver API. More...

Inheritance diagram for MediaWiki\Extension\Translate\WebService\MintCxserverWebService:
MediaWiki\Extension\Translate\WebService\CxserverWebService MediaWiki\Extension\Translate\WebService\TranslationWebService

Protected Member Functions

 handlePairsForService (array $response)
 
 getServiceName ()
 
 handleServiceResponse (array $responseBody)
 
 wrapUntranslatable (string $text)
 Some mangling that tries to keep some parts of the message unmangled by the translation service.
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\WebService\CxserverWebService
 mapCode (string $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.
 
 getQuery (string $text, string $sourceLanguage, string $targetLanguage)
 Get the query.
 
 parseResponse (TranslationQueryResponse $response)
 Get the response.
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 getSupportedLanguagePairs ()
 
 unwrapUntranslatable (string $text)
 Undo the hopyfully untouched mangling done by wrapUntranslatable.
 
 reportTranslationServiceFailure (string $msg)
 Increases the failure count for this service.
 

Additional Inherited Members

- Public Member Functions inherited from MediaWiki\Extension\Translate\WebService\CxserverWebService
 __construct (HttpRequestFactory $httpRequestFactory, string $service, array $config)
 
 getType ()
 Returns the type of this web service.
 
- Public Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 getName ()
 Gets the name of this service, for example to display it for the user.
 
 getQueries (string $text, string $sourceLanguage, string $targetLanguage)
 Get queries for this service.
 
 getResultData (TranslationQueryResponse $response)
 Get the web service specific response returned by QueryAggregator.
 
 __construct (string $service, array $config)
 
 isSupportedLanguagePair (string $sourceLanguage, string $targetLanguage)
 Test whether given language pair is supported by the service.
 
 setLogger (LoggerInterface $logger)
 
 checkTranslationServiceFailure ()
 Checks whether the service has exceeded failure count.
 
- Static Public Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
static factory (string $serviceName, array $config)
 Get a webservice handler.
 
- Protected Attributes inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 $service
 
 $config
 
 $logger
 
 $serviceFailureCount = 5
 
 $serviceFailurePeriod = 900
 

Detailed Description

Implements support for MinT translation service via the Cxserver API.

Author
Abijeet Patro @license GPL-2.0-or-later
Since
2023.06

Definition at line 13 of file MintCxserverWebService.php.

Member Function Documentation

◆ getServiceName()

MediaWiki\Extension\Translate\WebService\MintCxserverWebService::getServiceName ( )
protected

◆ handlePairsForService()

MediaWiki\Extension\Translate\WebService\MintCxserverWebService::handlePairsForService ( array $response)
protected

◆ handleServiceResponse()

MediaWiki\Extension\Translate\WebService\MintCxserverWebService::handleServiceResponse ( array $responseBody)
protected

◆ wrapUntranslatable()

MediaWiki\Extension\Translate\WebService\MintCxserverWebService::wrapUntranslatable ( string $text)
protected

Some mangling that tries to keep some parts of the message unmangled by the translation service.

Most of them support either class=notranslate or translate=no.

Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.

Definition at line 43 of file MintCxserverWebService.php.


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