#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 <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.526d20320c13da8e181b71e326446f17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.