Opened 9 years ago
Closed 9 years ago
#26403 closed Cleanup/optimization (fixed)
"Invalid block tag" message is English except for one word
Reported by: | Meiyer | Owned by: | amureki |
---|---|---|---|
Component: | Template system | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | yes |
Description (last modified by )
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.
Change History (12)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Easy pickings: | set |
---|---|
Summary: | Crazy translation in template processing error → "Invalid block tag" message is English except for one word |
Triage Stage: | Unreviewed → Accepted |
Version: | → 1.8 |
comment:3 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 9 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
comment:5 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
follow-up: 8 comment:6 by , 9 years ago
comment:7 by , 9 years ago
Needs tests: | set |
---|
comment:8 by , 9 years ago
Replying to 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.
comment:9 by , 9 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
comment:10 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Updated PR (https://github.com/django/django/pull/6386) with test.
comment:11 by , 9 years ago
Needs tests: | unset |
---|---|
Triage Stage: | Ready for checkin → Accepted |
The Ready for checkin
flag is not supposed to be set by the patch author, but by a reviewer.
What is the github pull request link?