ember-validations icon indicating copy to clipboard operation
ember-validations copied to clipboard

Allow error message to be customized declaratively

Open rkenshin opened this issue 12 years ago • 8 comments

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" }

rkenshin avatar Jan 13 '13 20:01 rkenshin

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 foo property in your example above)
  • on a property validation (e.g. on the presence validation of the foo property).

Do you have any thought?

lcoq avatar Jan 14 '13 19:01 lcoq

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.

vecsuresh avatar Apr 01 '13 05:04 vecsuresh

:+1:

niuage avatar May 01 '13 16:05 niuage

:+1:

midu avatar Jun 18 '13 20:06 midu

:thumbsup:

mawek avatar Jul 30 '13 20:07 mawek

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.

abobwhite avatar Jul 31 '13 19:07 abobwhite

:+1:

lholmquist avatar Aug 07 '13 15:08 lholmquist

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 !

lcoq avatar Aug 13 '13 06:08 lcoq