Opened 9 years ago

Last modified 9 years ago

#26403 closed Cleanup/optimization

Crazy translation in template processing error — at Version 1

Reported by: Meiyer Owned by: nobody
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 (1)

comment:1 by Meiyer, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top