SimpleSchema custom error messages


#1

Hi all,
I’m trying to use the tap:i18n strings for the error messages.

SimpleSchema.messages({
  maxString: TAPi18n.__("MAXSTRING_ERROR");
});

This does not work and meteor process is killed with following error message

TypeError: Object #<Object> has no method 'en'
    at [object Object].__ (packages/tap:i18n/lib/tap_i18n/tap_i18n-server.coffee:29:16)

Anyone has any idea on this? I may need a solution to https://github.com/aldeed/meteor-simple-schema/issues/176

@aldeed, can you please help me ?


#2

There was an issue with the script execution order. Its resolved now


#3

Hi, I’m experiencing the same issue. Can you please share how you fixed it? Thank you.

Update:
In my case, I eventually got it to work by executing the SimpleSchema.messages() on Meteor.startup as follows:

Meteor.startup(function () {
  SimpleSchema.messages({...});
});

Any comment is welcome, thank you.