Obviously simplified, but I'm attempting to build a string which I would pass into another messages.properties entry. For example, maybe I had entries that looked like this:
someField.sillyError.good=good
someField.sillyError.bad=bad
someField.validation.error=This has been a [{3}] morning
With validation that looked like this:
static constraints = {
someField(nullable: false, blank: false, validator: { val, obj ->
def someOtherEntry = g.message(code: 'someField.sillyError.' + val)
return ['someField.validation.error', someOtherEntry]
}
}
The call to g.message()
doesn't work, and I can't seem to use anything else to get it either.