diff --git a/core/modules/locale/src/LocaleTranslation.php b/core/modules/locale/src/LocaleTranslation.php index e9b693894e5..a9ccc93626f 100644 --- a/core/modules/locale/src/LocaleTranslation.php +++ b/core/modules/locale/src/LocaleTranslation.php @@ -119,6 +119,11 @@ class LocaleTranslation implements TranslatorInterface, DestructableInterface { $this->translations[$langcode][$context] = new LocaleLookup($langcode, $context, $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack); } $translation = $this->translations[$langcode][$context]->get($string); + // If the translation is TRUE, no translation exists, but that string needs + // to be stored in the persistent cache for performance reasons (so for + // example, we don't have hundreds of queries to locale tables on each + // request). That cache is persisted when the request ends, and the lookup + // service is destroyed. return $translation === TRUE ? FALSE : $translation; }