fix i18n of form validation messages

This commit is contained in:
Jan Dittberner 2009-01-21 22:46:59 +01:00
parent 379feed21f
commit 9c641cb79c

View file

@ -40,6 +40,9 @@ class DdportfolioController(BaseController):
def handle_post(self): def handle_post(self):
schema = DeveloperData() schema = DeveloperData()
try: try:
formencode.api.set_stdtranslation(
domain="FormEncode",
languages=[lang[0:2] for lang in request.languages])
form_result = schema.to_python(request.params) form_result = schema.to_python(request.params)
except formencode.validators.Invalid, error: except formencode.validators.Invalid, error:
c.messages = { 'errors' : error.unpack_errors() } c.messages = { 'errors' : error.unpack_errors() }