Localizing validation (error) messages in Grails
- by John
Hi,
I try to localize error messages from the Domain classes. This is possible with the default error messages, e.g.:
default.blank.message=Property [{0}] cannot be blank
and localized attribute names, e.g.:
customer.address.label=Customer address
Where "Customer" is my domain class and address is its attribute.
My problem is that I can't localize some attributes because I need specific error messages.
E.g:
has.to.be.a.number=Property [{0}] has to be a number
contingent.size.label=Contingent size.
But the message I get is "Property [size] has to be a number" instead of "Property [Contingent size] has to be a number".
The messages I cant localize are following:
- Property [{0}] has to be a number
- Property [{0}] has to be a valid date // I can't use g:datePicker in this context