Symfony2 Translate Assertion message from entity annotation

后端 未结 1 1168
情深已故
情深已故 2021-02-19 15:11

I have an entity with some validation and assertion messages. I need to translate that messages into arabic i have a messages.ar.xlf file The validation message from the Entity

相关标签:
1条回答
  • 2021-02-19 16:02

    The validation messages are get not from messages domain, but from validators one.

    So create validators.ar.xlf file and put your validation messages there and should be working (see the official Symfony2 documentation for reference).

    One more thing. Depending on what Symfony version do you use: maxLength assertion id deprecated from Symfony 2.1 and is removed in 2.3. So, if you use Symfony >2.0, then you should use Length assertion instead.

    0 讨论(0)
提交回复
热议问题