You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Using trans filters in twig templates without the translator installed results in a fatal error instead of just displaying the string to translate (as was the case in every other version I used before).
How to reproduce
Do the following:
composer create-project symfony/skeleton
composer require symfony/twig-bundle
composer require annotations
Make a controller that renders the base.html.twig
In the base.html.twig insert {{ 'test'|trans }}
Additional context
Stack Trace:
[Thu May 30 23:11:55.906614 2019] [php7:error] [pid 24356:tid 2000] [client ::1:53977] PHP Fatal error: Trait 'Symfony\Contracts\Translation\TranslatorTrait' not found in C:\xampp\htdocs\project2\vendor\symfony\twig-bridge\Extension\TranslationExtension.php on line 113
2019-05-30T23:11:55+02:00 [critical] Fatal Error: Trait 'Symfony\Contracts\Translation\TranslatorTrait' not found
2019-05-30T23:11:56+02:00 [critical] Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load trait "TranslatorTrait" from namespace "Symfony\Contracts\Translation".
Did you forget a "use" statement for another namespace?" at C:\xampp\htdocs\project2\vendor\symfony\twig-bridge\Extension\TranslationExtension.php line 113
The text was updated successfully, but these errors were encountered:
…nExtension is used (nicolas-grekas)
This PR was merged into the 4.3 branch.
Discussion
----------
[TwigBridge] suggest Translation Component when TranslationExtension is used
| Q | A
| ------------- | ---
| Branch? | 4.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #31754
| License | MIT
| Doc PR | -
Commits
-------
d4a9e7e [TwigBridge] suggest Translation Component when TranslationExtension is used
Symfony version(s) affected: 4.3.0
Description
Using trans filters in twig templates without the translator installed results in a fatal error instead of just displaying the string to translate (as was the case in every other version I used before).
How to reproduce
Do the following:
Additional context
Stack Trace:
[Thu May 30 23:11:55.906614 2019] [php7:error] [pid 24356:tid 2000] [client ::1:53977] PHP Fatal error: Trait 'Symfony\Contracts\Translation\TranslatorTrait' not found in C:\xampp\htdocs\project2\vendor\symfony\twig-bridge\Extension\TranslationExtension.php on line 113
2019-05-30T23:11:55+02:00 [critical] Fatal Error: Trait 'Symfony\Contracts\Translation\TranslatorTrait' not found
2019-05-30T23:11:56+02:00 [critical] Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load trait "TranslatorTrait" from namespace "Symfony\Contracts\Translation".
Did you forget a "use" statement for another namespace?" at C:\xampp\htdocs\project2\vendor\symfony\twig-bridge\Extension\TranslationExtension.php line 113
The text was updated successfully, but these errors were encountered: