You are here

protected function LingotekSourceStatus::getSourceStatusTextForUI in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 4.0.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  2. 3.2.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  3. 3.3.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  4. 3.4.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  5. 3.5.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  6. 3.7.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
  7. 3.8.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
1 call to LingotekSourceStatus::getSourceStatusTextForUI()
LingotekSourceStatus::preRender in src/Element/LingotekSourceStatus.php
Calculates the url and status title and adds them to the render array.

File

src/Element/LingotekSourceStatus.php, line 154

Class

LingotekSourceStatus
Provides a Lingotek source status element.

Namespace

Drupal\lingotek\Element

Code

protected function getSourceStatusTextForUI($component, $source_status) {
  switch ($source_status) {
    case Lingotek::STATUS_UNTRACKED:
    case Lingotek::STATUS_REQUEST:
      return t('Upload');
    case Lingotek::STATUS_DISABLED:
      return t('Disabled, cannot request translation');
    case Lingotek::STATUS_EDITED:
      return \Drupal::service('lingotek.interface_translation')
        ->getDocumentId($component) ? t('Re-upload (content has changed since last upload)') : t('Upload');
    case Lingotek::STATUS_IMPORTING:
      return t('Source importing');
    case Lingotek::STATUS_CURRENT:
      return t('Source uploaded');
    case Lingotek::STATUS_ERROR:
      return t('Error');
    case Lingotek::STATUS_CANCELLED:
      return $this
        ->t('Cancelled by user');
    default:
      return ucfirst(strtolower($source_status));
  }
}