Opened 11 years ago

Closed 10 years ago

#22886 closed Bug (worksforme)

Message wording when unique_together rises

Reported by: Vlada Macek Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

This one is IMHO not bound exactly to i18n as I think the msgid itself could be improved too.

db/models/base.py:991:

# unique_together
else:
    field_labels = [capfirst(opts.get_field(f).verbose_name) for f in unique_check]
    params['field_labels'] = six.text_type(get_text_list(field_labels, _('and')))
    return ValidationError(
        message=_("%(model_name)s with this %(field_labels)s already exists."),
        code='unique_together',
        params=params,
    )

For single field_label (one unique field constraint) there is a different msgid.

This one is used for the unique_together constraint so I'd expect 'these ... exist' or my favorite 'this combination of fields ... exists' would be better.

Change History (2)

comment:1 by Tim Graham, 11 years ago

I think the current version makes sense, e.g. "Book with this Title and Author already exists.".

As for your alternative suggestions:

"Book with these Title and Author exist." isn't correct.

"Book with this combination of Title and Author exists." seems okay, but I'm not sure it's much of an upgrade over the existing text.

comment:2 by Tim Graham, 10 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top