user741701
user741701

Reputation: 33

Grails i18 message properties

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.

Upvotes: 2

Views: 682

Answers (3)

Stephen Tun Aung
Stephen Tun Aung

Reputation: 992

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

Upvotes: 0

Lorna2000
Lorna2000

Reputation: 1

For a property foo:

typeMismatch.foo=Custom message

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

typeMismatch.formName.foo=Custom message

Upvotes: 0

Dónal
Dónal

Reputation: 187529

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

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

Upvotes: 2

Related Questions