We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string|\Stringable
Version: 3.0.18
The Nette\Utils\Translator interface allows returning both string|\Stringable. https://github.com/nette/utils/blob/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96/src/Translator.php#L21
Nette\Utils\Translator
But the Latte's translate filter which is ultimately used when tags {translate} and {_} are compiled forces the return value of type string.
translate
{translate}
{_}
latte/src/Latte/Essential/TranslatorExtension.php
Line 53 in bd46751
This causes an error when returning results of translation as an \Nette\Utils\Html objects (related to nette/utils#231).
\Nette\Utils\Html
public function getFilters(): array { return [ 'translate' => fn(Latte\Runtime\FilterInfo $fi, ...$args): string|\Stringable => $this->translator ? ($this->translator)(...$args) : $args[0], ]; }
The text was updated successfully, but these errors were encountered:
041a209
TranslatorExtension: translate() can return \Stringable [Closes #372]
c9a34d8
1273640
No branches or pull requests
Version: 3.0.18
Bug Description
The
Nette\Utils\Translator
interface allows returning bothstring|\Stringable
.https://github.com/nette/utils/blob/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96/src/Translator.php#L21
But the Latte's
translate
filter which is ultimately used when tags{translate}
and{_}
are compiled forces the return value of type string.latte/src/Latte/Essential/TranslatorExtension.php
Line 53 in bd46751
This causes an error when returning results of translation as an
\Nette\Utils\Html
objects (related to nette/utils#231).Possible Solution
The text was updated successfully, but these errors were encountered: