@rlesniak, here’s what I’ve done.
User = Astro.Class({
name: 'User',
collection: Meteor.users,
fields: {
username: 'string',
password: 'string',
profile: 'object',
"profile.roleId": 'string',
services: 'object',
createdAt: {
type: 'date',
default: function() {
return new Date();
}
}
},
validators: {
username: [
Validators.required(null, "Please provide a username"),
Validators.string(),
Validators.minLength(5)
],
password: [
Validators.required(null, "Please provide a password"),
Validators.string(),
// Several other validators here
],
profile: Validators.required(),
"profile.roleId": [
Validators.required(null, "Please select the Role for the user"),
Validators.string()
],
createdAt: [
Validators.required(),
Validators.date()
]
},
methods: {
role: function() {
return Roles.findOne({_id: this.profile.roleId});
}
}
});
Let me know if you need more help.
In my validation message I’m using TAPi18n
strings as follows but all I’m getting is the default english version:
username: [
Validators.required(null, TAPi18n.__('provideUsernameMessage', null, 'am')),
Validators.string(),
Validators.minLength(5, TAPi18n.__('usernameShortMessage', null, "am"))
],
It should be giving out the error message in Amharic, i.e. “የተጠቃሚ ስሙን ያስገብ” and “የተጠቃሚ ስሙ ፊደሎች ከ5 ወይም ከ5 በላይ መሆን አለባቸው”. I’ve tried elsewhere on the server side these messages do appear. How can I fix this?