protected function LingotekInterfaceTranslationService::clearTargetStatuses in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.2.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.3.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
- 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::clearTargetStatuses()
Clear the target statuses.
Parameters
string $component: The component.
1 call to LingotekInterfaceTranslationService::clearTargetStatuses()
- LingotekInterfaceTranslationService::checkTargetStatuses in src/
LingotekInterfaceTranslationService.php - Gets the current status of all the target translations.
File
- src/
LingotekInterfaceTranslationService.php, line 174
Class
- LingotekInterfaceTranslationService
- Service for managing Lingotek interface translations.
Namespace
Drupal\lingotekCode
protected function clearTargetStatuses($component) {
// Clear the target statuses. As we save the source status with the target,
// we need to keep that one.
$source_status = $this
->getSourceStatus($component);
$metadata = $this
->getMetadata($component);
if (!empty($metadata) && isset($metadata['translation_status'])) {
unset($metadata['translation_status']);
$this
->saveMetadata($component, $metadata);
}
$this
->setTargetStatus($component, 'en', $source_status);
}