Description
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:
- 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