10000 Do not log or call the proxy function when the locale is the same · symfony/symfony@31bdfb3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 31bdfb3

Browse files
gmponosfabpot
authored andcommitted
Do not log or call the proxy function when the locale is the same
1 parent 41ff9d3 commit 31bdfb3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Translation/LoggingTranslator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public function setLocale($locale)
8484
{
8585
$prev = $this->translator->getLocale();
8686
$this->translator->setLocale($locale);
87+
if ($prev === $locale) {
88+
return;
89+
}
90+
8791
$this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));
8892
}
8993

0 commit comments

Comments
 (0)
0