Hi all,
I am localizing an app that uses FormEncode in the way described in
the Pylons "form hadling" documentation, under "Validation the long
way". I can already localize the error message using something like
the following:
messages = {
'missingValue': 'Please select at least one.',
}
class InvoiceSearchForm(formencode.Schema):
ptypes = formencode.validators.NotEmpty(messages=messages)
itypes = formencode.validators.NotEmpty(messages=messages)
pstates = formencode.validators.NotEmpty(messages=messages)
sstates = formencode.validators.NotEmpty(messages=messages)
My problem is that the field name is used in the error display. For
example, with missing "itypes", I get the following error:
itypes: Please select at least one.
I would like to display a meaningful name instead of the field
internal name. Is there a ways to do that easily? It would be great if
I could do something like declaring in the schema:
itypes = formencode.validators.NotEmpty(name="Invoice types",
messages=messages)
but I haven't found a way yet.
Any help would be greatly appreciated.
(PS: I am localizing an app to Japanese, to just using more meaningful
field names is not an option ^^ )
Cheers,