public function LingotekContentTranslationService::setSourceStatus in Lingotek Translation 8.2
Same name and namespace in other branches
- 8 src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 4.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.0.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.1.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.2.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.3.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.4.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.5.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.6.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.7.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
- 3.8.x src/LingotekContentTranslationService.php \Drupal\lingotek\LingotekContentTranslationService::setSourceStatus()
Sets the translation status of a given entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface &$entity: The entity which status we want to change.
int $status: Status of the translation. Use Lingotek class constants.
Return value
\Drupal\Core\Entity\ContentEntityInterface
Overrides LingotekContentTranslationServiceInterface::setSourceStatus
8 calls to LingotekContentTranslationService::setSourceStatus()
- LingotekContentTranslationService::addTarget in src/
LingotekContentTranslationService.php - Request a translation for a given entity in the given locale.
- LingotekContentTranslationService::cancelDocument in src/
LingotekContentTranslationService.php - Cancels a document from the server.
- LingotekContentTranslationService::checkSourceStatus in src/
LingotekContentTranslationService.php - Checks the source is uploaded correctly.
- LingotekContentTranslationService::downloadDocument in src/
LingotekContentTranslationService.php - Downloads a document from the Lingotek service for a given locale.
- LingotekContentTranslationService::downloadDocuments in src/
LingotekContentTranslationService.php - Downloads a document from the Lingotek service for all available locales.
File
- src/
LingotekContentTranslationService.php, line 191
Class
- LingotekContentTranslationService
- Service for managing Lingotek content translations.
Namespace
Drupal\lingotekCode
public function setSourceStatus(ContentEntityInterface &$entity, $status) {
$metadata = $entity->lingotek_metadata->entity;
$source_language = $metadata->translation_source->value;
if ($source_language == LanguageInterface::LANGCODE_NOT_SPECIFIED || $source_language == NULL) {
$source_language = $entity
->getUntranslated()
->language()
->getId();
}
return $this
->setTargetStatus($entity, $source_language, $status);
}