Update LoggingTranslator to log the change of a locale

This commit is contained in:
Mponos George 2019-04-25 13:40:25 +03:00 committed by Fabien Potencier
parent fba11b4dc3
commit 20380f9afe

View File

@ -82,7 +82,9 @@ class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterfac
*/
public function setLocale($locale)
{
$prev = $this->translator->getLocale();
$this->translator->setLocale($locale);
$this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));
}
/**