I think it would be useful to have the option of the form validator "message" to be a function that the value and parameters are passed to so that transforms more complex than simple token substitution could be applied to the message.
example:
percentage: {
validator: (value, param) => {
if (parseFloat(value) < (param[0] * param[1])) {
return false;
}
return true;
},
message: (value, param) => {
return "Value (" + value + ") must be " + (param[0]*100) + "% of " + param[1] + " or more";
}
}
const rules = { field: "percentage[0.25,50]" }
note this is a simplified example, the use case I'd like is actually quite a bit more complex.