You are here

public function GlobalLinkTranslator::requestTranslation in GlobalLink Connect for Drupal 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php \Drupal\globallink\Plugin\tmgmt\Translator\GlobalLinkTranslator::requestTranslation()

@abstract

Submits the translation request and sends it to the translation provider.

During the translation process, Job::getItems() will only return job items that are not already fully translated.

Parameters

\Drupal\tmgmt\JobInterface $job: The job that should be submitted.

Overrides TranslatorPluginInterface::requestTranslation

See also

hook_tmgmt_job_before_request_translation()

hook_tmgmt_job_after_request_translation()

File

src/Plugin/tmgmt/Translator/GlobalLinkTranslator.php, line 494

Class

GlobalLinkTranslator
GlobalLink translation plugin controller.

Namespace

Drupal\globallink\Plugin\tmgmt\Translator

Code

public function requestTranslation(JobInterface $job) {
  $this
    ->requestJobItemsTranslation($job
    ->getItems());
  if (!$job
    ->isRejected()) {
    $job
      ->submitted('The translation job has been submitted.');
  }
}