NO-OP version of TtmServer when it is disabled. More...
Public Member Functions | |
query (string $sourceLanguage, string $targetLanguage, string $text) | |
Fetches all relevant suggestions for given text. | |
isLocalSuggestion (array $suggestion) | |
Determines if the suggestion returned by this TtmServer comes from this wiki or any other wiki. | |
expandLocation (array $suggestion) | |
Given suggestion returned by this TtmServer, constructs fully qualified URL to the location of the translation. | |
update (MessageHandle $handle, ?string $targetText) | |
Shovels the new translation into translation memory. | |
beginBootstrap () | |
Called when starting to fill the translation memory. | |
beginBatch () | |
Called before every batch (MessageGroup). | |
batchInsertDefinitions (array $batch) | |
Called multiple times per batch if necessary. | |
batchInsertTranslations (array $batch) | |
Called multiple times per batch if necessary. | |
endBatch () | |
Called after every batch (MessageGroup). | |
endBootstrap () | |
Do any cleanup, optimizing etc. | |
setDoReIndex () | |
Instruct the service to fully wipe the index and start from scratch. | |
Public Member Functions inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
__construct (array $config) | |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
static | sortSuggestions (array $suggestions) |
static | onDelete (WikiPage $wikipage) |
Hook: ArticleDeleteComplete. | |
static | onChange (MessageHandle $handle) |
Called from TranslateEditAddons::onSave. | |
static | onGroupChange (MessageHandle $handle, array $old) |
Protected Attributes inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
array | $config |
NO-OP version of TtmServer when it is disabled.
Keeps other code simpler when they can just do TTMServer::primary()->update( ... );
Definition at line 18 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::__construct | ( | ) |
Definition at line 19 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::batchInsertDefinitions | ( | array | $batch | ) |
Called multiple times per batch if necessary.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 45 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::batchInsertTranslations | ( | array | $batch | ) |
Called multiple times per batch if necessary.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 48 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::beginBatch | ( | ) |
Called before every batch (MessageGroup).
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 42 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::beginBootstrap | ( | ) |
Called when starting to fill the translation memory.
Set up necessary variables and remove old content from the server.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 39 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::endBatch | ( | ) |
Called after every batch (MessageGroup).
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 51 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::endBootstrap | ( | ) |
Do any cleanup, optimizing etc.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 54 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::expandLocation | ( | array | $suggestion | ) |
Given suggestion returned by this TtmServer, constructs fully qualified URL to the location of the translation.
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 31 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::isLocalSuggestion | ( | array | $suggestion | ) |
Determines if the suggestion returned by this TtmServer comes from this wiki or any other wiki.
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 27 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::query | ( | string | $sourceLanguage, |
string | $targetLanguage, | ||
string | $text ) |
Fetches all relevant suggestions for given text.
string | $sourceLanguage | language code for the provide text |
string | $targetLanguage | language code for the suggestions |
string | $text | the text for which to search suggestions |
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 23 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::setDoReIndex | ( | ) |
Instruct the service to fully wipe the index and start from scratch.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 57 of file FakeTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\FakeTtmServer::update | ( | MessageHandle | $handle, |
?string | $targetText ) |
Shovels the new translation into translation memory.
Use this for single updates (=after message edit). If no text is provided, entry will be removed from the translation memory.
MessageHandle | $handle | |
string | null | $targetText | Use null to only delete. |
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 35 of file FakeTtmServer.php.