flatiron/revalidator — pull request #11 by brainafk (2012-03-07 22:03:20+00:00)
Title: default messages and custom message support

I've filled in the default messages and implemented a way to define custom error messages.

If a message is just a string, it is used unchanged as the error message.
If it's of type array it will be used as follows:
`array[0]` `property.value` `array[1..n].join(' ')`

e.g.:
`title: { maxLength: 140 }` with format message: `["is too long (maximum is", "characters)"]` will lead to _is too long (maximum is 140 characters)_

Custom messages could be defined as follows:

properties: {
email: {
required: true,
format: 'email',
messages: {
required: "is required",
format: ["is not a valid"]
}
}
}

What do you think?