How to translate symfony form error messages?
问题 for symfony standalone translation component I use: $translator = new Translator('fr_FR'); $translator->addLoader('php', new \Symfony\Component\Translation\Loader\PhpFileLoader()); $translator->addResource('php', ROOT.'/translations/messages.fr.php', 'fr_FR'); $twig->addExtension(new TranslationExtension($translator)); It is working fine to translate symfony form labels. To translate symfony form constraint errors I use: ->add('firstname', TextType::class, [ 'constraints' => [new Assert