Emerson / ember-form-master-2000

A simple form builder for Ember built as an Ember-CLI addon.
MIT License
40 stars 18 forks source link

Feature request: i18n translation of error messages #9

Open zyllorion opened 9 years ago

zyllorion commented 9 years ago

Hi,

Please could you consider adding client side translation of field level error messages from a 422 response from the server.

{{t errors.message}} should work but not if multiple errors without loops etc, so it would ideally be done within the template of ember-form-master-2000, possibly an overridable function that can define any translation mechanism.

I'll admit I could probably just write a custom template to override this, but then that's a maintenance annoyance!

Thanks

Emerson commented 9 years ago

Not closing this yet, but the easy workaround would be to just override the template in your own app at:

/your-app/templates/components/ember-form-master-2000/fm-errortext.hbs

I'd like to make internationalization easy, but I'm not sure what the best path for this is at the moment. Most people using this library won't have Ember.i18n installed, which means we'd need to add some kind of detection to ensure the t helper is available.