You are here

public function SmartlingTranslator::requestJobItemsTranslation in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/tmgmt/Translator/SmartlingTranslator.php \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator::requestJobItemsTranslation()
  2. 8 src/Plugin/tmgmt/Translator/SmartlingTranslator.php \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator::requestJobItemsTranslation()
  3. 8.2 src/Plugin/tmgmt/Translator/SmartlingTranslator.php \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator::requestJobItemsTranslation()

Requests the translation of a JobItem.

Parameters

JobItemInterface[] $job_items: The JobItem we want to translate.

Overrides ContinuousTranslatorInterface::requestJobItemsTranslation

File

src/Plugin/tmgmt/Translator/SmartlingTranslator.php, line 633
Contains \Drupal\tmgmt_smartling\Plugin\tmgmt\Translator\SmartlingTranslator.

Class

SmartlingTranslator
Smartling translator plugin.

Namespace

Drupal\tmgmt_smartling\Plugin\tmgmt\Translator

Code

public function requestJobItemsTranslation(array $job_items) {

  /** @var \Drupal\tmgmt\Entity\Job $job */
  $job = reset($job_items)
    ->getJob();
  foreach ($job_items as $job_item) {

    //tmgmt_smartling_download_file($job_item->getJob());
    $this
      ->requestTranslation($job_item
      ->getJob());
    if ($job
      ->isContinuous()) {
      $job_item
        ->active();
    }
  }
}