class TestLocalTranslator in TMGMT Extension Suite 8.3
Drupal user provider.
Plugin annotation
@TranslatorPlugin(
id = "tes_local_test",
label = @Translation("TES local translator"),
description = @Translation("Allows local users to process translation jobs."),
ui = "\Drupal\tmgmt_local\LocalTranslatorUi",
default_settings = {},
map_remote_languages = FALSE
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\tmgmt\TranslatorPluginBase implements TranslatorPluginInterface
- class \Drupal\tmgmt_local\Plugin\tmgmt\Translator\LocalTranslator implements ContinuousTranslatorInterface
- class \Drupal\tmgmt_extension_suit_test\Plugin\tmgmt\Translator\TestLocalTranslator implements ExtendedTranslatorPluginInterface
- class \Drupal\tmgmt_local\Plugin\tmgmt\Translator\LocalTranslator implements ContinuousTranslatorInterface
- class \Drupal\tmgmt\TranslatorPluginBase implements TranslatorPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of TestLocalTranslator
File
- modules/
tmgmt_extension_suit_test/ src/ Plugin/ tmgmt/ Translator/ TestLocalTranslator.php, line 22
Namespace
Drupal\tmgmt_extension_suit_test\Plugin\tmgmt\TranslatorView source
class TestLocalTranslator extends LocalTranslator implements ExtendedTranslatorPluginInterface {
/**
* Checks whether job is ready for download or not.
*
* @param \Drupal\tmgmt\JobInterface $job
* Job object.
*
* @return bool
* TRUE if ready FALSE otherwise.
*/
public function isReadyForDownload(JobInterface $job) {
}
/**
* Downloads translation.
*
* Applies translation for all the job items inside the job if $jobitem is
* NULL. Applies translation to only one job item if $jobItem is passed.
*
* @param \Drupal\tmgmt\JobInterface $job
* Job object.
* @param JobItemInterface $jobItem
*
* @return bool
* TRUE if download process completed successfully
* FALSE otherwise.
*/
public function downloadTranslation(JobInterface $job, JobItemInterface $jobItem = NULL) {
}
/**
* Returns file name for a given job.
*
* @param \Drupal\tmgmt\JobInterface $job
* Job object.
*
* @return string
* Job file name.
*/
public function getFileName(JobInterface $job) {
}
/**
* Cancels translation.
*
* This method cancels not Drupal translation but translation in
* 3rd party service instead.
*
* @param \Drupal\tmgmt\JobInterface $job
* Job object.
*
* @return bool
* TRUE if canceled FALSE otherwise.
*/
public function cancelTranslation(JobInterface $job) {
}
/**
* Requests translation.
*
* @param \Drupal\tmgmt\JobInterface $job
* TMGMT Job.
* @param array $data
* Data from queue item.
*/
public function requestTranslationExtended(JobInterface $job, array $data) {
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
LocalTranslator:: |
protected | property | ||
LocalTranslator:: |
public | function |
Default implementation that gets target languages for each remote language.
This approach is ineffective and therefore it is advised that a plugin
should provide own implementation. Overrides TranslatorPluginBase:: |
|
LocalTranslator:: |
public | function |
Returns all available target languages that are supported by this service
when given a source language. Overrides TranslatorPluginBase:: |
|
LocalTranslator:: |
public | function |
Requests the translation of a JobItem. Overrides ContinuousTranslatorInterface:: |
|
LocalTranslator:: |
public | function |
@abstract Overrides TranslatorPluginInterface:: |
|
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TestLocalTranslator:: |
public | function |
Cancels translation. Overrides ExtendedTranslatorPluginInterface:: |
|
TestLocalTranslator:: |
public | function |
Downloads translation. Overrides ExtendedTranslatorPluginInterface:: |
|
TestLocalTranslator:: |
public | function |
Returns file name for a given job. Overrides ExtendedTranslatorPluginInterface:: |
|
TestLocalTranslator:: |
public | function |
Checks whether job is ready for download or not. Overrides ExtendedTranslatorPluginInterface:: |
|
TestLocalTranslator:: |
public | function |
Requests translation. Overrides ExtendedTranslatorPluginInterface:: |
|
TranslatorPluginBase:: |
protected | property | Characters that indicate the end of an escaped string. | 1 |
TranslatorPluginBase:: |
protected | property | Characters that indicate the beginning of an escaped string. | 1 |
TranslatorPluginBase:: |
public | function |
Aborts a translation job. Overrides TranslatorPluginInterface:: |
|
TranslatorPluginBase:: |
public | function |
Accept a single data item. Overrides TranslatorPluginInterface:: |
|
TranslatorPluginBase:: |
public | function |
Checks whether a translator is available. Overrides TranslatorPluginInterface:: |
1 |
TranslatorPluginBase:: |
public | function |
Check whether this service can handle a particular translation job. Overrides TranslatorPluginInterface:: |
2 |
TranslatorPluginBase:: |
public | function |
Defines default settings. Overrides TranslatorPluginInterface:: |
1 |
TranslatorPluginBase:: |
public | function |
Returns the escaped #text of a data item. Overrides TranslatorPluginInterface:: |
|
TranslatorPluginBase:: |
public | function |
Specifies default mappings for local to remote language codes. Overrides TranslatorPluginInterface:: |
1 |
TranslatorPluginBase:: |
protected | function | Returns the escaped string. | |
TranslatorPluginBase:: |
public | function |
Gets all supported languages of the translator. Overrides TranslatorPluginInterface:: |
|
TranslatorPluginBase:: |
public | function |
Returns if the translator has any settings for the passed job. Overrides TranslatorPluginInterface:: |
2 |
TranslatorPluginBase:: |
public | function |
Removes escape patterns from an escaped text. Overrides TranslatorPluginInterface:: |