public function LingotekConfigTranslationController::checkDownload in Lingotek Translation 8        
                          
                  
                        Same name and namespace in other branches
- 8.2 src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 4.0.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.0.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.1.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.2.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.3.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.4.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.5.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.6.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.7.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 - 3.8.x src/Controller/LingotekConfigTranslationController.php \Drupal\lingotek\Controller\LingotekConfigTranslationController::checkDownload()
 
 
1 string reference to 'LingotekConfigTranslationController::checkDownload'
  - lingotek.routing.yml in ./lingotek.routing.yml
 
  - lingotek.routing.yml
 
 
File
 
   - src/Controller/LingotekConfigTranslationController.php, line 375
 
  
  Class
  
  - LingotekConfigTranslationController 
 
  
  Namespace
  Drupal\lingotek\Controller
Code
public function checkDownload($entity_type, $entity_id, $locale, Request $request) {
  if ($entity_type === $entity_id) {
    
    $definition = $this->configMapperManager
      ->getDefinition($entity_type);
    try {
      if ($this->translationService
        ->checkConfigTargetStatus($entity_id, $locale)) {
        drupal_set_message($this
          ->t('Translation to %locale checked successfully', [
          '%locale' => $locale,
        ]));
      }
    } catch (LingotekApiException $e) {
      drupal_set_message($this
        ->t('%label @locale translation status check failed. Please try again.', [
        '%label' => $entity_id,
        '@locale' => $locale,
      ]), 'error');
    }
    return $this
      ->redirectToConfigTranslateOverview($entity_type);
  }
  
  if (substr($entity_type, -7) == '_fields') {
    
    $entity_type = 'field_config';
  }
  $entity = $this
    ->entityManager()
    ->getStorage($entity_type)
    ->load($entity_id);
  try {
    if ($this->translationService
      ->checkTargetStatus($entity, $locale)) {
      drupal_set_message($this
        ->t('Translation to %locale status checked successfully', [
        '%locale' => $locale,
      ]));
    }
  } catch (LingotekApiException $e) {
    drupal_set_message($this
      ->t('%label @locale translation status check failed. Please try again.', [
      '%label' => $entity
        ->label(),
      '@locale' => $locale,
    ]), 'error');
  }
  return $this
    ->redirectToEntityTranslateOverview($entity_type, $entity_id);
}