You are here

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

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\Translator
View 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

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
LocalTranslator::$language_pairs protected property
LocalTranslator::getSupportedLanguagePairs 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::getSupportedLanguagePairs
LocalTranslator::getSupportedTargetLanguages public function Returns all available target languages that are supported by this service when given a source language. Overrides TranslatorPluginBase::getSupportedTargetLanguages
LocalTranslator::requestJobItemsTranslation public function Requests the translation of a JobItem. Overrides ContinuousTranslatorInterface::requestJobItemsTranslation
LocalTranslator::requestTranslation public function @abstract Overrides TranslatorPluginInterface::requestTranslation
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 92
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TestLocalTranslator::cancelTranslation public function Cancels translation. Overrides ExtendedTranslatorPluginInterface::cancelTranslation
TestLocalTranslator::downloadTranslation public function Downloads translation. Overrides ExtendedTranslatorPluginInterface::downloadTranslation
TestLocalTranslator::getFileName public function Returns file name for a given job. Overrides ExtendedTranslatorPluginInterface::getFileName
TestLocalTranslator::isReadyForDownload public function Checks whether job is ready for download or not. Overrides ExtendedTranslatorPluginInterface::isReadyForDownload
TestLocalTranslator::requestTranslationExtended public function Requests translation. Overrides ExtendedTranslatorPluginInterface::requestTranslationExtended
TranslatorPluginBase::$escapeEnd protected property Characters that indicate the end of an escaped string. 1
TranslatorPluginBase::$escapeStart protected property Characters that indicate the beginning of an escaped string. 1
TranslatorPluginBase::abortTranslation public function Aborts a translation job. Overrides TranslatorPluginInterface::abortTranslation
TranslatorPluginBase::acceptedDataItem public function Accept a single data item. Overrides TranslatorPluginInterface::acceptedDataItem
TranslatorPluginBase::checkAvailable public function Checks whether a translator is available. Overrides TranslatorPluginInterface::checkAvailable 1
TranslatorPluginBase::checkTranslatable public function Check whether this service can handle a particular translation job. Overrides TranslatorPluginInterface::checkTranslatable 2
TranslatorPluginBase::defaultSettings public function Defines default settings. Overrides TranslatorPluginInterface::defaultSettings 1
TranslatorPluginBase::escapeText public function Returns the escaped #text of a data item. Overrides TranslatorPluginInterface::escapeText
TranslatorPluginBase::getDefaultRemoteLanguagesMappings public function Specifies default mappings for local to remote language codes. Overrides TranslatorPluginInterface::getDefaultRemoteLanguagesMappings 1
TranslatorPluginBase::getEscapedString protected function Returns the escaped string.
TranslatorPluginBase::getSupportedRemoteLanguages public function Gets all supported languages of the translator. Overrides TranslatorPluginInterface::getSupportedRemoteLanguages
TranslatorPluginBase::hasCheckoutSettings public function Returns if the translator has any settings for the passed job. Overrides TranslatorPluginInterface::hasCheckoutSettings 2
TranslatorPluginBase::unescapeText public function Removes escape patterns from an escaped text. Overrides TranslatorPluginInterface::unescapeText