Do not log or call the proxy function when the locale is the same
This commit is contained in:
parent
41ff9d31d4
commit
31bdfb372c
@ -84,6 +84,10 @@ class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterfac
|
|||||||
{
|
{
|
||||||
$prev = $this->translator->getLocale();
|
$prev = $this->translator->getLocale();
|
||||||
$this->translator->setLocale($locale);
|
$this->translator->setLocale($locale);
|
||||||
|
if ($prev === $locale) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));
|
$this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user