LaxarJS / laxar-patterns

Utilities to implement standard event patterns in LaxarJS widgets
MIT License
5 stars 2 forks source link

validation: Fix error event messages #55

Closed alex3683 closed 7 years ago

alex3683 commented 9 years ago

Currently the factories for success and error events set the messages under the key htmlMessages, although they may be internationalized. Hence this field should be renamed to i18nHtmlMessages. The ax-messages-widget already handles the correct and the legacy case. For the next major release this should be cleaned up.

alex3683 commented 7 years ago

Implemented on master (v2.0.0).

Breaking Change

Usages of htmlMessage need to be changed to i18nHtmlMessage, since the provided messages object may be internationalized. So the result of a validation handler must be changed from this

return [ { htmlMessage: { en: 'This is <em>wrong</em>', de: 'Falsch!' }, level: 'ERROR' } ];

into this:

return [ { i18nHtmlMessage: { en: 'This is <em>wrong</em>', de: 'Falsch!' }, level: 'ERROR' } ];