From c9a34d8565a5a7d13fc0702b9bb6cc441824003d Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 7 Oct 2024 01:38:32 +0200 Subject: [PATCH] TranslatorExtension: translate() can return \Stringable [Closes #372] --- src/Latte/Essential/TranslatorExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Latte/Essential/TranslatorExtension.php b/src/Latte/Essential/TranslatorExtension.php index f5d202f70..738991881 100644 --- a/src/Latte/Essential/TranslatorExtension.php +++ b/src/Latte/Essential/TranslatorExtension.php @@ -50,7 +50,7 @@ public function getTags(): array public function getFilters(): array { return [ - 'translate' => fn(Latte\Runtime\FilterInfo $fi, ...$args): string => $this->translator + 'translate' => fn(Latte\Runtime\FilterInfo $fi, ...$args) => $this->translator ? ($this->translator)(...$args) : $args[0], ];