smcmahon/Products.PloneFormGen — Issue #10: Validation error of isEmail validator is not translated
Author: markvl
Created: 2011-11-01 11:15:02+00:00
State: open

When the isEmail validator is enabled on a field and the input is not a valid email address, the error message is only partially translated. For example in a Dutch site:

> "Validatie mislukt (pfgv_isEmail): 'foo' fails tests of pfgv_isEmail".

The first part ("Validatie mislukt") is Dutch, but the rest obviously is not. In English the error message is as expected by the way ("This is not a valid email address.").

I can see that in `content/validationMessages.py` the `cleanupMessage` function tries to transform the unfriendly message in something understandable for the user of the site by using the `verrorRE` regexp. But that regexp doesn't match the error message since it's already translated partially.

For what it's worth, I did find out that the partial translation happens in `Products.validation.validators.RegexValidator` where `recursiveTranslate` is being called.