You are here

protected function LingotekConfigManagementForm::getSourceStatusText in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  2. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  3. 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  4. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  5. 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  6. 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  7. 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  8. 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  9. 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  10. 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
  11. 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatusText()
1 call to LingotekConfigManagementForm::getSourceStatusText()
LingotekConfigManagementForm::getSourceStatus in src/Form/LingotekConfigManagementForm.php
Gets the source status of an config in a format ready to display.

File

src/Form/LingotekConfigManagementForm.php, line 1410

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getSourceStatusText(ConfigMapperInterface $mapper, $status) {
  $is_config_entity = $mapper instanceof ConfigEntityMapper;
  $entity = $is_config_entity ? $mapper
    ->getEntity() : NULL;
  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 $is_config_entity ? $this->translationService
        ->getDocumentId($entity) : $this->translationService
        ->getConfigDocumentId($mapper) ? $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');
    case Lingotek::STATUS_CANCELLED:
      return $this
        ->t('Cancelled by user');
    default:
      return ucfirst(strtolower($status));
  }
}