1

Given a constraint on an object using message placeholders, e.g.

/**
 * @Assert\MaxLength(limit = 25, message = "name.length.invalid")
 */
public $name;

where

name.length.invalid: 'Please enter a shorter name.'

Why does Symfony by default force message pluralization rules when trying to render a message that has a pluralized component? If I have a pluralization on the message (as is the case because of the max length's limit) and an intentionally non-pluralized message specified (as above), why does Symfony force me to specify some form of pluralization rather than just using the non-pluralized form of the message?

I don't want to have to explicitly define ranges for pluralization (e.g. '[0, Inf] Please enter a shorter name.') as it should be implicit by the existence of translation choices. Also providing explicit pluralization choices (e.g. 'Please enter a shorter name|Please enter a shorter name') in the case above is redundant.

Are there better ways of handling this situation, or situations like this?

NB: The above case is illustrative, clearly there are improvements that could be made if this message were being presented to an actual end user.

Another example of the same issue can be seen in the following question: double translation in symfony2

Community
  • 1
  • 1
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
  • [This is going to be fixed in a comming release](https://github.com/symfony/symfony/pull/6988). I don't think you can solve it now. – Wouter J Feb 25 '13 at 21:49
  • Thanks for the insight @WouterJ; would you mind adding that comment as an answer so I can mark this as answered? – Sean Quinn Feb 26 '13 at 14:20
  • thank you, but I don't think it is an actual answer. So I think it is better to leave this open and see if someone has a solution in the coming days/weeks. – Wouter J Feb 26 '13 at 14:27

0 Answers0