public function LocaleTranslationCacheTag::saveTranslation in Drupal 8
Same name and namespace in other branches
- 9 core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php \Drupal\locale\EventSubscriber\LocaleTranslationCacheTag::saveTranslation()
Invalidate cache tags whenever a string is translated.
File
- core/
modules/ locale/ src/ EventSubscriber/ LocaleTranslationCacheTag.php, line 34
Class
- LocaleTranslationCacheTag
- A subscriber invalidating cache tags when translating a string.
Namespace
Drupal\locale\EventSubscriberCode
public function saveTranslation() {
$this->cacheTagsInvalidator
->invalidateTags([
'rendered',
'locale',
'library_info',
]);
}