8000 bug #32014 Do not log or call the proxy function when the locale is t… · symfony/symfony@dab7a55 · GitHub
[go: up one dir, main page]

Skip to content

Commit dab7a55

Browse files
committed
bug #32014 Do not log or call the proxy function when the locale is the same (gmponos)
This PR was squashed before being merged into the 4.3 branch (closes #32014). Discussion ---------- Do not log or call the proxy function when the locale is the same | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT I was the one creating the PR for logging the change of the locale but ATM I am filled with logs of translator about switching the locale from "en" to "en".. Not sure why. Commits ------- 31bdfb3 Do not log or call the proxy function when the locale is the same
2 parents e635775 + 31bdfb3 commit dab7a55

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