[Django] #26403: Crazy translation in template processing error

9 views
Skip to first unread message

Django

unread,
Mar 24, 2016, 6:38:56 AM3/24/16
to django-...@googlegroups.com
#26403: Crazy translation in template processing error
--------------------------------------+--------------------
Reporter: interDist | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version:
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------------+--------------------
The `invalid_block_tag()` function of template `Parser` makes use of the
`django.utils.text.get_text_list()` function to generate the list of
expected block tags. The only caveat is that `get_text_list()` takes a
concatenation parameter whose default value is the **translated** string
`or`, while the rest of the error message is untranslated. This results in
crazy messages such as
Invalid block tag: 'qq', expected 'xx','yy' 或 'zz'
(for 1.8 and earlier).

Looks like the solution should be easy: pass the `'or'` concatenator to
`get_text_list()` instead of relying on the default value.

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

Django

unread,
Mar 24, 2016, 6:42:33 AM3/24/16
to django-...@googlegroups.com
#26403: Crazy translation in template processing error
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

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


Old description:

> The `invalid_block_tag()` function of template `Parser` makes use of the
> `django.utils.text.get_text_list()` function to generate the list of
> expected block tags. The only caveat is that `get_text_list()` takes a
> concatenation parameter whose default value is the **translated** string
> `or`, while the rest of the error message is untranslated. This results
> in crazy messages such as
> Invalid block tag: 'qq', expected 'xx','yy' 或 'zz'
> (for 1.8 and earlier).
>
> Looks like the solution should be easy: pass the `'or'` concatenator to
> `get_text_list()` instead of relying on the default value.

New description:

The `invalid_block_tag()` function of template `Parser` makes use of the
`django.utils.text.get_text_list()` function to generate the list of
expected block tags. The only caveat is that `get_text_list()` takes a
concatenation parameter whose default value is the **translated** string
`or`, while the rest of the error message is untranslated. This results in
crazy messages such as
Invalid block tag: 'qq', expected 'xx','yy' 或 'zz'
(for 1.8 and earlier)

Invalid block tag on line 234: 'qq', expected 'xx','yy' 或 'zz'. Did
you forget to register or load this tag?
(for 1.9 and later).

Looks like the solution should be easy: pass the `'or'` concatenator to
`get_text_list()` instead of relying on the default value.

--

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

Django

unread,
Mar 24, 2016, 7:35:13 AM3/24/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
--------------------------------------+------------------------------------

Reporter: interDist | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Template system | Version: 1.8
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 timgraham):

* version: => 1.8
* easy: 0 => 1
* stage: Unreviewed => Accepted


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

Django

unread,
Mar 24, 2016, 1:19:16 PM3/24/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner:
Type: | andersonresende
Cleanup/optimization | Status: assigned

Component: Template system | Version: 1.8
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 andersonresende):

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


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

Django

unread,
Apr 3, 2016, 4:14:49 AM4/3/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
--------------------------------------+------------------------------------
Reporter: interDist | Owner: amureki
Type: Cleanup/optimization | Status: assigned

Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* owner: andersonresende => amureki
* has_patch: 0 => 1


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

Django

unread,
Apr 3, 2016, 7:04:13 AM4/3/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: amureki
Type: | Status: assigned
Cleanup/optimization |

Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Apr 3, 2016, 9:50:00 AM4/3/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: amureki
Type: | Status: assigned
Cleanup/optimization |
Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by susan):

What is the github pull request link?

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

Django

unread,
Apr 3, 2016, 9:53:40 AM4/3/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: amureki
Type: | Status: assigned
Cleanup/optimization |
Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

* needs_tests: 0 => 1


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

Django

unread,
Apr 4, 2016, 3:47:13 AM4/4/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: amureki
Type: | Status: assigned
Cleanup/optimization |
Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by amureki):

Replying to [comment:6 susan]:


> What is the github pull request link?

It is displayed in top menu on "Pull requests" part.

Here is fast link: https://github.com/django/django/pull/6386

P.S. I'll update it with tests as needed.

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

Django

unread,
Apr 4, 2016, 7:11:48 AM4/4/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
--------------------------------------+------------------------------------
Reporter: interDist | Owner: amureki
Type: Cleanup/optimization | Status: assigned

Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* stage: Ready for checkin => Accepted


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

Django

unread,
Apr 8, 2016, 7:09:58 PM4/8/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
-------------------------------------+-------------------------------------
Reporter: interDist | Owner: amureki
Type: | Status: assigned
Cleanup/optimization |

Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


Comment:

Updated PR (https://github.com/django/django/pull/6386) with test.

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

Django

unread,
Apr 9, 2016, 3:39:25 AM4/9/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
--------------------------------------+------------------------------------
Reporter: interDist | Owner: amureki
Type: Cleanup/optimization | Status: assigned

Component: Template system | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

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

* needs_tests: 1 => 0


* stage: Ready for checkin => Accepted


Comment:

The `Ready for checkin` flag is not supposed to be set by the patch
author, but by a reviewer.

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

Django

unread,
Apr 9, 2016, 9:40:45 AM4/9/16
to django-...@googlegroups.com
#26403: "Invalid block tag" message is English except for one word
--------------------------------------+------------------------------------
Reporter: interDist | Owner: amureki
Type: Cleanup/optimization | Status: closed

Component: Template system | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 1
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"f8bbba80607435c68f34207bc1e9a133a3f9ffee" f8bbba80]:
{{{
#!CommitTicketReference repository=""
revision="f8bbba80607435c68f34207bc1e9a133a3f9ffee"
Fixed #26403 -- Removed translated content in "Invalid block tag" message.
}}}

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

Reply all
Reply to author
Forward
0 new messages