public function LingotekInterfaceTranslationService::markTranslationsAsDirty in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 4.0.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.2.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.4.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.5.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.6.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.7.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
- 3.8.x src/LingotekInterfaceTranslationService.php \Drupal\lingotek\LingotekInterfaceTranslationService::markTranslationsAsDirty()
Marks the translation status as dirty if they exist.
Parameters
string $component: The component which status we want to change.
Return value
string
Overrides LingotekInterfaceTranslationServiceInterface::markTranslationsAsDirty
File
- src/
LingotekInterfaceTranslationService.php, line 348
Class
- LingotekInterfaceTranslationService
- Service for managing Lingotek interface translations.
Namespace
Drupal\lingotekCode
public function markTranslationsAsDirty($component) {
$target_languages = $this->languageManager
->getLanguages();
$source_langcode = 'en';
// Only mark as out of date the current ones.
$to_change = [
Lingotek::STATUS_CURRENT,
];
foreach ($target_languages as $langcode => $language) {
if ($langcode != $source_langcode && ($current_status = $this
->getTargetStatus($component, $langcode))) {
if (in_array($current_status, $to_change)) {
$this
->setTargetStatus($component, $langcode, Lingotek::STATUS_PENDING);
}
}
}
}