You are here

public function LocaleTranslationCacheTag::saveTranslation in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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 39
Contains \Drupal\locale\EventSubscriber\LocaleTranslationCacheTag.

Class

LocaleTranslationCacheTag
A subscriber invalidating cache tags when translating a string.

Namespace

Drupal\locale\EventSubscriber

Code

public function saveTranslation() {
  $this->cacheTagsInvalidator
    ->invalidateTags([
    'rendered',
    'locale',
  ]);
}