Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 451b440

Browse files
bug #31599 [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector (althaus)
This PR was submitted for the master branch but it was squashed and merged into the 4.2 branch instead (closes #31599). Discussion ---------- [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector I'm not sure when this gets executed, but overriding `$trans` directly after the `if` simply looks wrong. | Q | A | ------------- | --- | Branch? | 4.3-beta2, but last change at that position is a couple of months | Bug fix? | yes, me thinks | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT Cheers Matthias Commits ------- a1677c7 [Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector
2 parents 19741a4 + a1677c7 commit 451b440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Translation/DataCollectorTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public function transChoice($id, $number, array $parameters = [], $domain = null
6868
{
6969
if ($this->translator instanceof TranslatorInterface) {
7070
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
71+
} else {
72+
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
7173
}
7274

73-
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
74-
7575
$this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters);
7676

7777
return $trans;

0 commit comments

Comments
 (0)