Loading core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidato * Invalidate cache tags whenever a string is translated. */ public function saveTranslation() { $this->cacheTagsInvalidator->invalidateTags(['rendered', 'locale']); $this->cacheTagsInvalidator->invalidateTags(['rendered', 'locale', 'library_info']); } /** Loading core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,8 @@ public function testLocaleTranslationJsDependencies() { $js_filename = $prefix . '_' . $js_translation_files[$prefix] . '.js'; $content = $this->getSession()->getPage()->getContent(); $this->assertRaw('core/misc/drupal.js'); $this->assertRaw($js_filename); // Assert translations JS is included before drupal.js. $this->assertTrue(strpos($content, $js_filename) < strpos($content, 'core/misc/drupal.js'), 'Translations are included before Drupal.t.'); } Loading Loading
core/modules/locale/src/EventSubscriber/LocaleTranslationCacheTag.php +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public function __construct(CacheTagsInvalidatorInterface $cache_tags_invalidato * Invalidate cache tags whenever a string is translated. */ public function saveTranslation() { $this->cacheTagsInvalidator->invalidateTags(['rendered', 'locale']); $this->cacheTagsInvalidator->invalidateTags(['rendered', 'locale', 'library_info']); } /** Loading
core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,8 @@ public function testLocaleTranslationJsDependencies() { $js_filename = $prefix . '_' . $js_translation_files[$prefix] . '.js'; $content = $this->getSession()->getPage()->getContent(); $this->assertRaw('core/misc/drupal.js'); $this->assertRaw($js_filename); // Assert translations JS is included before drupal.js. $this->assertTrue(strpos($content, $js_filename) < strpos($content, 'core/misc/drupal.js'), 'Translations are included before Drupal.t.'); } Loading