[Django] #22887: unique_for_date error message in Field has untranslated param lookup_type

37 views
Skip to first unread message

Django

unread,
Jun 23, 2014, 7:16:04 AM6/23/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+--------------------
Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 1
--------------------------------------+--------------------
In the error message

{{{%(field_label)s must be unique for %(date_field_label)s
%(lookup_type)s.}}}

the {{{lookup_type}}} is always one of "date", "year", "month" which can
only work in English.

I think there should be a separate error message for each
{{{lookup_type}}}.

The key 'unique_for_date' in the default_error_messages dict looks like it
is already specific for the {{{lookup_type == "date"}}} anyway. :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/22887>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 23, 2014, 7:16:48 AM6/23/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
-------------------------------------+-------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
Internationalization | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Tuttle):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:1>

Django

unread,
Jun 23, 2014, 11:43:23 AM6/23/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by claudep):

* stage: Unreviewed => Accepted


Comment:

Accepted on the base that we should at least provide a translator comment
for this string. I admit that such constructed sentences might be a
nightmare for translators, however there is almost always some solution,
by rephrasing the sentence to give more meaning for the target language.
For example in French, we translate this with something like
`%(field_label)s must be unique for the %(lookup_type)s part of
%(date_field_label)s.`

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:2>

Django

unread,
Jul 25, 2014, 11:40:29 PM7/25/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------

Reporter: Tuttle | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by gmunumel):

I'd like to made this change. But I don't have clear what's it looking
for? May I have to translate {{{lookup_type}}} into three translated
words, for example, in spanish would be: fecha(date), año(year) and
mes(month)?

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:3>

Django

unread,
Jul 26, 2014, 5:24:05 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by synasius):

* status: new => assigned
* owner: nobody => synasius


--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:4>

Django

unread,
Jul 26, 2014, 6:17:53 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by synasius):

My work is available here:
https://github.com/synasius/django/tree/ticket_22887

The aim is to clarify the meaning of the message so it can be easier to
translate in different languages.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:5>

Django

unread,
Jul 26, 2014, 7:56:51 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"6eed751162f10a3e93f4fa7c1eed2c43b70bb0ca"]:
{{{
#!CommitTicketReference repository=""
revision="6eed751162f10a3e93f4fa7c1eed2c43b70bb0ca"
Fixed #22887 -- Added comment for translators on unique_for_date error
message
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:6>

Django

unread,
Jul 26, 2014, 7:59:48 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"bc3d401b9f95ebc5bd25488708b5a82074c53ebb"]:
{{{
#!CommitTicketReference repository=""
revision="bc3d401b9f95ebc5bd25488708b5a82074c53ebb"
[1.7.x] Fixed #22887 -- Added comment for translators on unique_for_date
error message

Backport of 6eed751162 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:7>

Django

unread,
Jul 26, 2014, 8:24:55 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by Tuttle):

Replying to [comment:2 claudep]:


> Accepted on the base that we should at least provide a translator
comment for this string. I admit that such constructed sentences might be
a nightmare for translators, however there is almost always some solution,
by rephrasing the sentence to give more meaning for the target language.
For example in French, we translate this with something like
`%(field_label)s must be unique for the %(lookup_type)s part of
%(date_field_label)s.`


Thanks for at least adding the comment for translators. It's a pity the
proper solution was not taken as this is IMO one of the **very few cases**
in django-i18n where suboptimal tricks need to be used. Even the presented
french way keeps the English word around.

I have nothing against English, but Django is aimed at the broad audience
and I value very much how professional the entire django-i18n effort is
and I try to keep up for my language.

Once anyone starts to cut corners, all the depending workers will start to
see easier and lower quality paths too.

I thought extending {{{default_error_messages}}} with two additional
messages was not very expensive and pretty clean.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:8>

Django

unread,
Jul 26, 2014, 9:16:57 AM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by claudep):

I don't completely exclude having different messages, but I fear potential
code complexity. Maybe having a patch would help evaluate the feasibility.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:9>

Django

unread,
Jul 26, 2014, 4:51:31 PM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by Tuttle):

Replying to [comment:9 claudep]:


> I don't completely exclude having different messages, but I fear
potential code complexity. Maybe having a patch would help evaluate the
feasibility.

Thank you. I think it could be quite terse, offering the patch.
makemessages not done.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:10>

Django

unread,
Jul 26, 2014, 9:02:21 PM7/26/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: closed
Component: Internationalization | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------

Comment (by gmunumel):

Hahaha. I finished my patch just to realized that @tuttle already made one
:S. But at the end it's almost the same as mine.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:11>

Django

unread,
Aug 3, 2014, 7:45:17 AM8/3/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Tuttle):

* status: closed => new
* resolution: fixed =>


Comment:

I hope you don't mind if I reopen so it can be reconsidered. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:12>

Django

unread,
Aug 23, 2014, 7:50:39 PM8/23/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
-------------------------------------+-------------------------------------
Reporter: Tuttle | Owner: synasius
Type: | Status: new
Cleanup/optimization | Version: master
Component: | Resolution:
Internationalization | Triage Stage:
Severity: Normal | Unreviewed
Keywords: | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 1
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_docs: 0 => 1
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* easy: 1 => 0
* stage: Accepted => Unreviewed


Comment:

I'm not passing final judgement, but the proposed patch is backwards
incompatible for anyone currently using a custom error message with the
`unique_for_date` key. I will bump it back to unreviewed since this
approach hasn't been accepted yet.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:13>

Django

unread,
Aug 24, 2014, 2:25:57 PM8/24/14
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Tuttle | Owner: synasius
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by claudep):

* stage: Unreviewed => Accepted


Comment:

In any case, it's a compromise. On one side a bit more verbosity with a
slight backwards incompatibility, on the other side better translated
messages.

After some thoughts, having literal untranslated `date`/`year`/`month`
words inside a user-facing message seems really non optimal in my eyes, so
I tend to favor the proposed patch. Docs are missing, though.

--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:14>

Django

unread,
Feb 9, 2023, 5:45:04 AM2/9/23
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Vlada Macek | Owner: (none)
Type: Cleanup/optimization | Status: assigned
Component: Internationalization | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Federico Frenguelli => (none)


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:15>

Django

unread,
Feb 9, 2023, 5:45:08 AM2/9/23
to django-...@googlegroups.com
#22887: unique_for_date error message in Field has untranslated param lookup_type
--------------------------------------+------------------------------------
Reporter: Vlada Macek | Owner: (none)
Type: Cleanup/optimization | Status: new

Component: Internationalization | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/22887#comment:16>

Reply all
Reply to author
Forward
0 new messages