Issue #2188715 by penyaskito, amanshukla6158, mrinalini9, smustgrave, YesCT, quietone: Document return value in \Drupal\locale\LocaleTranslation::getStringTranslation

merge-requests/3620/merge
catch 2023-04-17 09:24:00 +01:00
parent f0723652ef
commit aa306d7cbf
1 changed files with 5 additions and 0 deletions

View File

@ -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); $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); $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; return $translation === TRUE ? FALSE : $translation;
} }