Skip to content

Commit 20380f9

Browse files
gmponosfabpot
authored andcommitted
Update LoggingTranslator to log the change of a locale
1 parent fba11b4 commit 20380f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Translation/LoggingTranslator.php

+2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public function transChoice($id, $number, array $parameters = [], $domain = null
8282
*/
8383
public function setLocale($locale)
8484
{
85+
$prev = $this->translator->getLocale();
8586
$this->translator->setLocale($locale);
87+
$this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));
8688
}
8789

8890
/**

0 commit comments

Comments
 (0)