You are here

protected function LingotekManagementForm::getTargetStatusText in Lingotek Translation 8

1 call to LingotekManagementForm::getTargetStatusText()
LingotekManagementForm::formatTranslations in src/Form/LingotekManagementForm.php
Formats the translation statuses for display.

File

src/Form/LingotekManagementForm.php, line 1019
Contains \Drupal\Lingotek\Form\LingotekManagementForm.

Class

LingotekManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getTargetStatusText($entity, $status, $langcode) {
  $language = ConfigurableLanguage::load($langcode);
  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_INTERMEDIATE:
      return $language
        ->label() . ' - ' . $this
        ->t('In-progress (interim translation downloaded)');
    case Lingotek::STATUS_CURRENT:
      return $language
        ->label() . ' - ' . $this
        ->t('Current');
    case Lingotek::STATUS_EDITED:
      return $language
        ->label() . ' - ' . $this
        ->t('Not current');
    default:
      return $language
        ->label() . ' - ' . ucfirst(strtolower($status));
  }
}