Opened 9 years ago
Last modified 9 years ago
#26403 closed Cleanup/optimization
Crazy translation in template processing error — at Initial Version
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
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.