public function LingotekBatchController::downloadSingle in Lingotek Translation 3.0.x
Same name and namespace in other branches
- 8 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 8.2 src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 4.0.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.1.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.2.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.3.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.4.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.5.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.6.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.7.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
- 3.8.x src/Controller/LingotekBatchController.php \Drupal\lingotek\Controller\LingotekBatchController::downloadSingle()
1 call to LingotekBatchController::downloadSingle()
- LingotekBatchController::dispatch in src/
Controller/ LingotekBatchController.php
File
- src/
Controller/ LingotekBatchController.php, line 50
Class
Namespace
Drupal\lingotek\ControllerCode
public function downloadSingle($entity_type, $entity_id, $locales) {
$batch = [
'title' => $this
->t('Downloading translations from Lingotek'),
'operations' => $this
->getDownloadOperations($entity_type, [
$entity_id,
], $locales),
'finished' => 'lingotek_operation_content_download_finished',
'file' => drupal_get_path('module', 'lingotek') . '/lingotek.batch.inc',
];
$entity = \Drupal::entityTypeManager()
->getStorage($entity_type)
->load($entity_id);
$redirect_url = \Drupal::urlGenerator()
->generate("entity.{$entity_type}.content_translation_overview", [
$entity_type => $entity_id,
], UrlGeneratorInterface::ABSOLUTE_URL);
batch_set($batch);
return batch_process($redirect_url);
}