You are here

protected function LingotekConfigManagementForm::getTargetStatusText in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  2. 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  3. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  4. 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  5. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  6. 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  7. 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  8. 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  9. 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  10. 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetStatusText()
  11. 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 1431

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

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');
      default:
        return $language
          ->label() . ' - ' . ucfirst(strtolower($status));
    }
  }
}