You are here

protected function LingotekManagementForm::getSourceStatusText in Lingotek Translation 8

1 call to LingotekManagementForm::getSourceStatusText()
LingotekManagementForm::getSourceStatus in src/Form/LingotekManagementForm.php
Gets the source status of an entity in a format ready to display.

File

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

Class

LingotekManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getSourceStatusText($entity, $status) {
  switch ($status) {
    case Lingotek::STATUS_UNTRACKED:
    case Lingotek::STATUS_REQUEST:
      return $this
        ->t('Upload');
    case Lingotek::STATUS_DISABLED:
      return $this
        ->t('Disabled, cannot request translation');
    case Lingotek::STATUS_EDITED:
      return $this->translationService
        ->getDocumentId($entity) ? $this
        ->t('Re-upload (content has changed since last upload)') : $this
        ->t('Upload');
    case Lingotek::STATUS_IMPORTING:
      return $this
        ->t('Source importing');
    case Lingotek::STATUS_CURRENT:
      return $this
        ->t('Source uploaded');
    case Lingotek::STATUS_ERROR:
      return $this
        ->t('Error');
    default:
      return ucfirst(strtolower($status));
  }
}