{"action":"created","issue":{"url":"https://api.github.com/repos/insin/newforms/issues/58","labels_url":"https://api.github.com/repos/insin/newforms/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/insin/newforms/issues/58/comments","events_url":"https://api.github.com/repos/insin/newforms/issues/58/events","html_url":"https://github.com/insin/newforms/issues/58","id":58160749,"number":58,"title":"Error messages not being interpolated","user":{"login":"kevzettler","id":126209,"avatar_url":"https://avatars.githubusercontent.com/u/126209?v=3","gravatar_id":"","url":"https://api.github.com/users/kevzettler","html_url":"https://github.com/kevzettler","followers_url":"https://api.github.com/users/kevzettler/followers","following_url":"https://api.github.com/users/kevzettler/following{/other_user}","gists_url":"https://api.github.com/users/kevzettler/gists{/gist_id}","starred_url":"https://api.github.com/users/kevzettler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevzettler/subscriptions","organizations_url":"https://api.github.com/users/kevzettler/orgs","repos_url":"https://api.github.com/users/kevzettler/repos","events_url":"https://api.github.com/users/kevzettler/events{/privacy}","received_events_url":"https://api.github.com/users/kevzettler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-19T02:35:05Z","updated_at":"2015-02-19T10:25:27Z","closed_at":null,"body":"Using a custom widget with `IntegerField` i'm seeing un-interpolated error messages\r\n![screenshot 2015-02-18 18 30 26](https://cloud.githubusercontent.com/assets/126209/6260992/8d3ca664-b79c-11e4-9f52-5a4c2518f955.png)\r\n\r\n\r\n\r\n```javascript\r\nvar quantityForm = newforms.Form.extend({\r\n                quantity: forms.IntegerField({\r\n                    name: 'quantity',\r\n                    maxValue: 6,\r\n                    widget: Form.NFQuantitySelector({\r\n                        defaultValue: 5\r\n                    })\r\n                }),\r\n            });\r\n```\r\n\r\nI'm doing some custom error output that looks like :\r\n\r\n```javascript\r\n                errs.errors[field_id].data.forEach(function(err_obj){\r\n                    var message = '';\r\n                    if(label != null){\r\n                        message += label + \". \";\r\n                    }\r\n                    message += err_obj.message;\r\n                    err_messages.push(message);\r\n```\r\nI guess I need to manually do the interpolation here? can you point me to where thats done within newforms?"},"comment":{"url":"https://api.github.com/repos/insin/newforms/issues/comments/75029060","html_url":"https://github.com/insin/newforms/issues/58#issuecomment-75029060","issue_url":"https://api.github.com/repos/insin/newforms/issues/58","id":75029060,"user":{"login":"insin","id":226692,"avatar_url":"https://avatars.githubusercontent.com/u/226692?v=3","gravatar_id":"","url":"https://api.github.com/users/insin","html_url":"https://github.com/insin","followers_url":"https://api.github.com/users/insin/followers","following_url":"https://api.github.com/users/insin/following{/other_user}","gists_url":"https://api.github.com/users/insin/gists{/gist_id}","starred_url":"https://api.github.com/users/insin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insin/subscriptions","organizations_url":"https://api.github.com/users/insin/orgs","repos_url":"https://api.github.com/users/insin/repos","events_url":"https://api.github.com/users/insin/events{/privacy}","received_events_url":"https://api.github.com/users/insin/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T10:25:27Z","updated_at":"2015-02-19T10:25:27Z","body":"[Error message parameters are passed to `ValidationError`](http://newforms.readthedocs.org/en/latest/validation.html#throwing-validationerror) and interpolation is done by its [`messages()` method](http://newforms.readthedocs.org/en/latest/validation_api.html#validationerror).\r\n\r\nIf you're working with an `ErrorObject` directly, the [ErrorList objects it contains have a `messages()` method](http://newforms.readthedocs.org/en/latest/validation_api.html#ErrorList#messages) which will do that for you.\r\n\r\nThis is how you can do it while sticking to the [public Error API](http://newforms.readthedocs.org/en/latest/validation_api.html#errors)\r\n\r\n```javascript\r\nerrs.get(field_id).messages().forEach(function(message) {\r\n  if (label != null) {\r\n    message = label + '. ' + message\r\n  }\r\n  err_messages.push(message)\r\n```"}}