Unverified Commit d6048ecc authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3089764 by alexpott, mondrake: Updating translations does not clear the...

Issue #3089764 by alexpott, mondrake: Updating translations does not clear the JS asset cache so new translations are not loaded
parent 75e601c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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']);
  }

  /**
+2 −0
Original line number Diff line number Diff line
@@ -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.');
  }