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>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* 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>
* version: => 1.8
* easy: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:2>
* status: new => assigned
* owner: nobody => andersonresende
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:3>
* owner: andersonresende => amureki
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:5>
Comment (by susan):
What is the github pull request link?
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:6>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:7>
Comment (by amureki):
Replying to [comment:6 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:8>
* stage: Ready for checkin => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:9>
* stage: Accepted => Ready for checkin
Comment:
Updated PR (https://github.com/django/django/pull/6386) with test.
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:10>
* needs_tests: 1 => 0
* stage: Ready for checkin => Accepted
Comment:
The `Ready for checkin` flag is not supposed to be set by the patch
author, but by a reviewer.
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:11>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f8bbba80607435c68f34207bc1e9a133a3f9ffee" f8bbba80]:
{{{
#!CommitTicketReference repository=""
revision="f8bbba80607435c68f34207bc1e9a133a3f9ffee"
Fixed #26403 -- Removed translated content in "Invalid block tag" message.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26403#comment:12>