Grails i18 message properties

690 Views Asked by At

I want to change the default message for typemismatch.java.math.BigDecimal in i18 message properties file for different properties.

In the documentation it says, use typeMismatch.$className.$propertyName to customize but that does not work for me.

Did anyone come across this issue. Any help is appreciated.

3

There are 3 best solutions below

0
On

For a property foo:

typeMismatch.foo=Custom message

Or more specific, for a property foo in a form:

typeMismatch.formName.foo=Custom message

0
On

To override the default message, you need fully qualified class name at $className of documentation typeMismatch.$className.$propertyName.

Eg. typeMismatch.com.xxx.hrms.Employee.salary=Please Enter valid number

1
On

For a property foo, the following should override the default message:

typeMismatch.java.math.BigDecimal.foo=Property {0} must be a valid number