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
-------
a1677c78a6
[Translation] Fixed issue with new vs old TranslatorInterface in TranslationDataCollector
This commit is contained in:
commit
451b4406d2
@ -68,9 +68,9 @@ class DataCollectorTranslator implements LegacyTranslatorInterface, TranslatorIn
|
|||||||
{
|
{
|
||||||
if ($this->translator instanceof TranslatorInterface) {
|
if ($this->translator instanceof TranslatorInterface) {
|
||||||
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
$trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
|
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
|
||||||
|
}
|
||||||
|
|
||||||
$this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters);
|
$this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user