Used for interacting with translation services supported by Cxserver. More...
Public Member Functions | |
__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. | |
Protected Member Functions | |
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. | |
handlePairsForService (array $response) | |
getServiceName () | |
handleServiceResponse (array $responseBody) | |
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 | |
Used for interacting with translation services supported by Cxserver.
Definition at line 16 of file CxserverWebService.php.
MediaWiki\Extension\Translate\WebService\CxserverWebService::__construct | ( | HttpRequestFactory | $httpRequestFactory, |
string | $service, | ||
array | $config ) |
Definition at line 19 of file CxserverWebService.php.
|
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.
TranslationWebServiceException | |
TranslationWebServiceConfigurationException |
Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.
Definition at line 39 of file CxserverWebService.php.
|
protected |
Get the query.
See getQueries for the public method.
string | $text | Text to translate. |
string | $sourceLanguage | Language code of the text, as used by the service. |
string | $targetLanguage | Language code of the translation, as used by the service. |
TranslationWebServiceException | |
TranslationWebServiceConfigurationException | |
TranslationWebServiceInvalidInputException |
Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.
Definition at line 54 of file CxserverWebService.php.
MediaWiki\Extension\Translate\WebService\CxserverWebService::getType | ( | ) |
Returns the type of this web service.
Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.
Definition at line 31 of file CxserverWebService.php.
|
protected |
Map a MediaWiki (almost standard) language code to the code used by the translation service.
Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.
Definition at line 35 of file CxserverWebService.php.
|
protected |
Get the response.
See getResultData for the public method.
TranslationWebServiceException |
Reimplemented from MediaWiki\Extension\Translate\WebService\TranslationWebService.
Definition at line 64 of file CxserverWebService.php.