Skip to content

Commit c5832c1

Browse files
committed
Merge branch '7.2' into 7.3
* 7.2: remove an invalid test [Translation] fix support of `TranslatableInterface` in `IdentityTranslator` Fix various bool-type coercions
2 parents dfa5e05 + cbd9be0 commit c5832c1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/Extension/Fixtures/StubTranslator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111

1212
namespace Symfony\Bridge\Twig\Tests\Extension\Fixtures;
1313

14+
use Symfony\Contracts\Translation\TranslatableInterface;
1415
use Symfony\Contracts\Translation\TranslatorInterface;
1516

1617
class StubTranslator implements TranslatorInterface
1718
{
1819
public function trans($id, array $parameters = [], $domain = null, $locale = null): string
1920
{
21+
foreach ($parameters as $k => $v) {
22+
if ($v instanceof TranslatableInterface) {
23+
$parameters[$k] = $v->trans($this, $locale);
24+
}
25+
}
26+
2027
return '[trans]'.strtr($id, $parameters).'[/trans]';
2128
}
2229

0 commit comments

Comments
 (0)