diff --git a/django/contrib/postgres/fields/array.py b/django/contrib/postgres/fields/array.py index d2c17438619..ab667acd5bf 100644 --- a/django/contrib/postgres/fields/array.py +++ b/django/contrib/postgres/fields/array.py @@ -19,7 +19,7 @@ __all__ = ['ArrayField'] class ArrayField(CheckFieldDefaultMixin, Field): empty_strings_allowed = False default_error_messages = { - 'item_invalid': _('Item %(nth)s in the array did not validate: '), + 'item_invalid': _('Item %(nth)s in the array did not validate:'), 'nested_array_mismatch': _('Nested arrays must have the same length.'), } _default_hint = ('list', '[]') diff --git a/django/contrib/postgres/forms/array.py b/django/contrib/postgres/forms/array.py index 6c18a37ebf6..554a39d4f6b 100644 --- a/django/contrib/postgres/forms/array.py +++ b/django/contrib/postgres/forms/array.py @@ -13,7 +13,7 @@ from ..utils import prefix_validation_error class SimpleArrayField(forms.CharField): default_error_messages = { - 'item_invalid': _('Item %(nth)s in the array did not validate: '), + 'item_invalid': _('Item %(nth)s in the array did not validate:'), } def __init__(self, base_field, *, delimiter=',', max_length=None, min_length=None, **kwargs): @@ -167,7 +167,7 @@ class SplitArrayWidget(forms.Widget): class SplitArrayField(forms.Field): default_error_messages = { - 'item_invalid': _('Item %(nth)s in the array did not validate: '), + 'item_invalid': _('Item %(nth)s in the array did not validate:'), } def __init__(self, base_field, size, *, remove_trailing_nulls=False, **kwargs): diff --git a/django/contrib/postgres/utils.py b/django/contrib/postgres/utils.py index 9f92f4059f4..f3c022f4740 100644 --- a/django/contrib/postgres/utils.py +++ b/django/contrib/postgres/utils.py @@ -17,7 +17,7 @@ def prefix_validation_error(error, prefix, code, params): # ngettext calls require a count parameter and are converted # to an empty string if they are missing it. message=format_lazy( - '{}{}', + '{} {}', SimpleLazyObject(lambda: prefix % params), SimpleLazyObject(lambda: error.message % error_params), ),