thedersen/backbone.validation — pull request #26 by josjevv (2012-02-24 10:13:46+00:00)
Title: User friendly names for attributes in validation messages

this is my first github contribution, so excuse me if I am doing something wrong.

instead of e.g. 'postalCode is required', 'Postal code is required' will be displayed. This saved me from creating a lot of custom validation messages. Please verify if this is acceptable or that it may be better to provide an extra argument to the validator functions, so custom validators which are dependent on the real attr will continue to work.

Example in model:

Backbone.Model.extend({
validation: {
postalCode: {
required: true,
pattern: 'postalCode'
},
houseNumber: {
required: true
}
},

labels: {
postalCode: 'postal code',
houseNumber: 'House number'
}
});