protected function LingotekTargetStatuses::getTargetStatusText in Lingotek Translation 3.2.x
Same name and namespace in other branches
- 8.2 src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
- 3.0.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
- 3.1.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
- 3.3.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
- 3.4.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
- 3.5.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::getTargetStatusText()
Get the source status label.
Parameters
string $status: The target status.
string $langcode: The language code.
Return value
string The source status human-friendly label.
2 calls to LingotekTargetStatuses::getTargetStatusText()
- LingotekTargetStatuses::getTranslationsStatuses in src/
Element/ LingotekTargetStatuses.php - Gets the translation status of an entity in a format ready to display.
- LingotekTargetStatuses::getTranslationsStatusesForUI in src/
Element/ LingotekTargetStatuses.php
File
- src/
Element/ LingotekTargetStatuses.php, line 173
Class
- LingotekTargetStatuses
- Provides a Lingotek target status element.
Namespace
Drupal\lingotek\ElementCode
protected function getTargetStatusText($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');
case Lingotek::STATUS_ERROR:
return $language
->label() . ' - ' . $this
->t('Error');
case Lingotek::STATUS_CANCELLED:
return $language
->label() . ' - ' . $this
->t('Cancelled by user');
default:
return $language
->label() . ' - ' . ucfirst(strtolower($status));
}
}