protected function LingotekConfigManagementForm::getTargetStatusText in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 - 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
 
1 call to LingotekConfigManagementForm::getTargetStatusText()
- LingotekConfigManagementForm::formatTranslations in src/
Form/ LingotekConfigManagementForm.php  - Formats the translation statuses for display.
 
File
- src/
Form/ LingotekConfigManagementForm.php, line 1491  
Class
- LingotekConfigManagementForm
 - Form for bulk management of content.
 
Namespace
Drupal\lingotek\FormCode
protected function getTargetStatusText(ConfigMapperInterface $mapper, $status, $langcode) {
  $language = ConfigurableLanguage::load($langcode);
  if ($language) {
    switch ($status) {
      case Lingotek::STATUS_UNTRACKED:
        return $language
          ->label() . ' - ' . $this
          ->t('Translation exists, but it is not being tracked by Lingotek');
      case Lingotek::STATUS_REQUEST:
        return $language
          ->label() . ' - ' . $this
          ->t('Request translation');
      case Lingotek::STATUS_PENDING:
        return $language
          ->label() . ' - ' . $this
          ->t('In-progress');
      case Lingotek::STATUS_READY:
        return $language
          ->label() . ' - ' . $this
          ->t('Ready for Download');
      case Lingotek::STATUS_CURRENT:
        return $language
          ->label() . ' - ' . $this
          ->t('Current');
      case Lingotek::STATUS_EDITED:
        return $language
          ->label() . ' - ' . $this
          ->t('Not current');
      case Lingotek::STATUS_INTERMEDIATE:
        return $language
          ->label() . ' - ' . $this
          ->t('In-progress (interim translation downloaded)');
      case Lingotek::STATUS_ERROR:
        return $language
          ->label() . ' - ' . $this
          ->t('Error');
      case Lingotek::STATUS_CANCELLED:
        return $language
          ->label() . ' - ' . $this
          ->t('Cancelled by user');
      case Lingotek::STATUS_DELETED:
        if ($mapper
          ->hasTranslation($language)) {
          return $language
            ->label() . ' - ' . $this
            ->t('This target was deleted in Lingotek and the translation exists.');
        }
        return $language
          ->label() . ' - ' . $this
          ->t('This target was deleted in Lingotek and the translation does not exist.');
      case Lingotek::STATUS_ARCHIVED:
        if ($mapper
          ->hasTranslation($language)) {
          return $language
            ->label() . ' - ' . $this
            ->t('This target was archived in Lingotek and the translation exists.');
        }
        return $language
          ->label() . ' - ' . $this
          ->t('This target was archived in Lingotek and the translation does not exist.');
      default:
        return $language
          ->label() . ' - ' . ucfirst(strtolower($status));
    }
  }
}