VulcanJS / Vulcan

🌋 A toolkit to quickly build apps with React, GraphQL & Meteor
http://vulcanjs.org
MIT License
7.98k stars 1.89k forks source link

Need to flesh out form error messages #2135

Closed Neobii closed 5 years ago

Neobii commented 5 years ago

Default error messages for form fields are missing such as errors.minNumber

Apollinaire commented 5 years ago

@Neobii thanks for submitting this. Some error messages are missing indeed, could you maybe list the ids, and what they mean? I'm guessing they are from SimpleSchema validation ? In that case, the only thing to do is add an i18n string { 'errors.minNumber': 'The field "{label}" must be higher than {min}' }. The file to change is here : https://github.com/VulcanJS/Vulcan/blob/devel/packages/vulcan-i18n-en-us/lib/en_US.js for the english version. You can submit a PR if you want to!

Neobii commented 5 years ago

I'll list the ids, I think someone else should write the copy :).

Apollinaire commented 5 years ago

Adding my own contribution:

{
  'errors.expectedType': `Expected type {dataType} for field “{label}”, received "{value}” instead.`,
  'errors.required': `Field "{label}" is required`,
  'errors.maxString': `Field “{label}” is limited to {max} characters.`,
  'errors.regEx': `Field "{label}": wrong formatting`,
}
Neobii commented 5 years ago

Still need Spanish and French versions.

SachaG commented 5 years ago

Can we close this?

Neobii commented 5 years ago

we can, unless you want to wait until someone fills out Spanish and French versions.

SachaG commented 5 years ago

No, I think we'll worry about that when we set up an official process for translating.