protected function LingotekSourceStatus::getSourceStatusTextForUI in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 4.0.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 3.2.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 3.3.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 3.4.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 3.6.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 3.7.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceStatusTextForUI()
- 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\ElementCode
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));
}
}