I added a lazy_gettext function in the other week which should handle
that. For example:
from turbogears.i18n import lazy_gettext
v=validators.MinLength(minLength=3,
messages={'tooShort':lazy_gettext('Enter at least %(minLength)i
characters')})

The lazy_gettext function calls gettext only when the message is being
converted to a string or string substitution is taking place. This
means you can "mark" strings for translation before the user locale is
known. This is useful for form encode error messages and form widget
labels, for example, which are declared in advance.

Reply via email to