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 Meiyer)

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 Meiyer, 9 years ago

Description: modified (diff)

comment:2 by Tim Graham, 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: UnreviewedAccepted
Version: 1.8

comment:3 by Anderson Resende, 9 years ago

Owner: changed from nobody to Anderson Resende
Status: newassigned

comment:4 by amureki, 9 years ago

Has patch: set
Owner: changed from Anderson Resende to amureki

comment:5 by amureki, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Susan Tan, 9 years ago

What is the github pull request link?

comment:7 by Marc Tamlyn, 9 years ago

Needs tests: set

in reply to:  6 comment:8 by amureki, 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 Tim Graham, 9 years ago

Triage Stage: Ready for checkinAccepted

comment:10 by amureki, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:11 by Claude Paroz, 9 years ago

Needs tests: unset
Triage Stage: Ready for checkinAccepted

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

comment:12 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In f8bbba80:

Fixed #26403 -- Removed translated content in "Invalid block tag" message.

Note: See TracTickets for help on using tickets.
Back to Top