locale: add lazy translations to missing ValidationErrors

This commit is contained in:
Herculino Trotta
2025-01-04 18:17:06 -03:00
parent 3c0a2d82ac
commit 5ccb9ff152
4 changed files with 12 additions and 10 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ class MonthYearModelField(models.DateField):
# Set the day to 1
return date.replace(day=1).date()
except ValueError:
raise ValidationError("Invalid date format. Use YYYY-MM.")
raise ValidationError(_("Invalid date format. Use YYYY-MM."))
def formfield(self, **kwargs):
kwargs["widget"] = MonthYearWidget