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