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

Implements support for Yandex translation API v1. More...

Inheritance diagram for MediaWiki\Extension\Translate\WebService\YandexWebService:
MediaWiki\Extension\Translate\WebService\TranslationWebService

Public Member Functions

 __construct (HttpRequestFactory $httpRequestFactory, string $serviceName, array $config)
 
 getType ()
 @inheritDoc
 
- 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.
 

Protected Member Functions

 mapCode (string $code)
 @inheritDoc
 
 doPairs ()
 @inheritDoc
 
 getQuery (string $text, string $sourceLanguage, string $targetLanguage)
 @inheritDoc
 
 parseResponse (TranslationQueryResponse $response)
 @inheritDoc
 
- Protected Member Functions inherited from MediaWiki\Extension\Translate\WebService\TranslationWebService
 getSupportedLanguagePairs ()
 
 wrapUntranslatable (string $text)
 Some mangling that tries to keep some parts of the message unmangled by the translation service.
 
 unwrapUntranslatable (string $text)
 Undo the hopyfully untouched mangling done by wrapUntranslatable.
 
 reportTranslationServiceFailure (string $msg)
 Increases the failure count for this service.
 

Additional Inherited Members

- 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 Yandex translation API v1.

Author
Niklas Laxström @license GPL-2.0-or-later
Since
2013.01
See also
https://tech.yandex.com/translate/

Definition at line 18 of file YandexWebService.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\WebService\YandexWebService::__construct ( HttpRequestFactory $httpRequestFactory,
string $serviceName,
array $config )

Definition at line 21 of file YandexWebService.php.

Member Function Documentation

◆ doPairs()

MediaWiki\Extension\Translate\WebService\YandexWebService::doPairs ( )
protected

@inheritDoc

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

Definition at line 48 of file YandexWebService.php.

◆ getQuery()

MediaWiki\Extension\Translate\WebService\YandexWebService::getQuery ( string $text,
string $sourceLanguage,
string $targetLanguage )
protected

@inheritDoc

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

Definition at line 70 of file YandexWebService.php.

◆ getType()

MediaWiki\Extension\Translate\WebService\YandexWebService::getType ( )

@inheritDoc

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

Definition at line 35 of file YandexWebService.php.

◆ mapCode()

MediaWiki\Extension\Translate\WebService\YandexWebService::mapCode ( string $code)
protected

@inheritDoc

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

Definition at line 40 of file YandexWebService.php.

◆ parseResponse()

MediaWiki\Extension\Translate\WebService\YandexWebService::parseResponse ( TranslationQueryResponse $response)
protected

@inheritDoc

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

Definition at line 91 of file YandexWebService.php.


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