Closed Reinmar-De-Grasse closed 8 years ago
Did you specify the prefix as custom_errors
as documented here: https://github.com/jasonmit/ember-i18n-cp-validations#customizing-the-prefix
Maybe in the future I'll drop the prefix
, but currently that's required if you are namespacing under custom_errors
instead of the default errors
With prefix (app/validators/messages.js):
import ValidatorsMessages from 'ember-cp-validations/validators/messages';
export default ValidatorsMessages.extend({
prefix: 'custom_errors'
});
and:
name: validator('presence', {presence: true, messageKey: 'custom_errors.empty_entity_name'}),
i got: {description} can't be blank
With prefix and:
name: validator('presence', {presence: true, messageKey: 'empty_entity_name'}),
i got: {description} can't be blank
I just want custom path to error message for concrete field. May be custom path inside default "errors". How?
I cannot reproduce this, run the above app and look at what I am doing versus what you have in your project. Reopen if you still have issues and can reproduce it with an example app like the one above.
I think it was an older version of ember-i18n-cp-validations (2.6.0 in your link versus my 2.4.0).
I update all dependencies up to your example and it works now. Thank you!
I have: app/locales/en/translations.js
app/models/entity.js
but my messageKey just ignored at getMessageFor: i18n.t(key, options) and errors.blank used