Commits

Anonymous committed 20b43f4

dateutil: use translation hooks. Refs #32.

Comments (0)

Files changed (1)

wtforms/ext/dateutil/fields.py

             date_str = u' '.join(valuelist)
             if not date_str:
                 self.data = None
-                raise ValidationError(u'Please input a date/time value')
+                raise ValidationError(self.gettext(u'Please input a date/time value'))
 
             parse_kwargs = self.parse_kwargs.copy()
             if 'default' not in parse_kwargs:
                 self.data = parser.parse(date_str, **parse_kwargs)
             except ValueError:
                 self.data = None
-                raise ValidationError(u'Invalid date/time input')
+                raise ValidationError(self.gettext(u'Invalid date/time input'))
 
 
 class DateField(DateTimeField):