ember-validations
ember-validations copied to clipboard
Allow error message to be customized declaratively
Apart from explicitly overriding the message with the right key, i didn't see anywhere in the source code to declaratively add custom error message
Ember.ValidationError.addMessage('blank', "can't be blank");
vs
foo { presence: true message: "This is a required field" }
This is an interesting feature, and I think it should be possible to set custom messages at different levels:
- globally (using
Ember.ValidationError.addMessage()) - on a property (e.g. on the
fooproperty in your example above) - on a property validation (e.g. on the
presencevalidation of thefooproperty).
Do you have any thought?
Is there any progress going on this? It would be very useful if framework allows to specify custom messages at property validation level as specified in the above scenario for better and more customizations.
:+1:
:+1:
:thumbsup:
I am working on a website that is heavily dependent on i18n and need error messages to be defined manually depending on the language...so to use ember-validations, I will need this feature.
:+1:
I also hope to see this feature soon. I do not have the time needed to implement it soon, but I'll be glad to consider a PR !