[Django] #26883: makemessages doesn't find blocktrans if it comes after a comment in templates

22 views
Skip to first unread message

Django

unread,
Jul 8, 2016, 12:19:17 PM7/8/16
to django-...@googlegroups.com
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
--------------------------------------+--------------------
Reporter: dAnjou | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version:
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
I had a template containing a line like the following:

{{{
{# some comment with the word blocktrans #}{% blocktrans with foo=bar
%}text text text
}}}

The blocktrans gets closed some lines below. When running makemessages now
it didn't find this blocktrans, only after I've removed the comment it
found it and created a msgid for it.

Even though I experienced this in a Django 1.4.22 project I got told in
#django on FreeNode that such a comment needs to be on a separate line
which the docs don't say a word about:
https://docs.djangoproject.com/ja/1.9/topics/templates/#comments

--
Ticket URL: <https://code.djangoproject.com/ticket/26883>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 8, 2016, 12:21:01 PM7/8/16
to django-...@googlegroups.com
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
-------------------------------------+-------------------------------------

Reporter: dAnjou | Owner: nobody
Type: Bug | Status: new
Component: | Version:
Internationalization |
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: 0
-------------------------------------+-------------------------------------
Changes (by dAnjou):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

> I had a template containing a line like the following:
>
> {{{
> {# some comment with the word blocktrans #}{% blocktrans with foo=bar
> %}text text text
> }}}
>
> The blocktrans gets closed some lines below. When running makemessages
> now it didn't find this blocktrans, only after I've removed the comment
> it found it and created a msgid for it.
>
> Even though I experienced this in a Django 1.4.22 project I got told in
> #django on FreeNode that such a comment needs to be on a separate line
> which the docs don't say a word about:
> https://docs.djangoproject.com/ja/1.9/topics/templates/#comments

New description:

I had a template containing a line like the following:

{{{
{# some comment with the word blocktrans #}{% blocktrans with foo=bar
%}text text text
}}}

The blocktrans gets closed some lines below. When running makemessages now
it didn't find this blocktrans, only after I've removed the comment it
found it and created a msgid for it.

Even though I experienced this in a Django 1.4.22 project (which I know is
EOL by now) I got told in #django on FreeNode that such a comment needs to


be on a separate line which the docs don't say a word about:
https://docs.djangoproject.com/ja/1.9/topics/templates/#comments

--

--
Ticket URL: <https://code.djangoproject.com/ticket/26883#comment:1>

Django

unread,
Jul 16, 2016, 9:12:04 PM7/16/16
to django-...@googlegroups.com
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
-------------------------------------+-------------------------------------

Reporter: dAnjou | Owner: nobody
Type: Bug | Status: new
Component: | Version:
Internationalization |
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: 0
-------------------------------------+-------------------------------------

Comment (by audiolion):

This could be something to do with how comments are tokenized in
django.utils.translation
https://github.com/django/django/blob/master/django/utils/translation/trans_real.py#L607

--
Ticket URL: <https://code.djangoproject.com/ticket/26883#comment:2>

Django

unread,
Jul 19, 2016, 11:39:46 AM7/19/16
to django-...@googlegroups.com
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
--------------------------------------+------------------------------------

Reporter: dAnjou | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* version: => master
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26883#comment:3>

Django

unread,
Aug 26, 2016, 12:21:15 PM8/26/16
to django-...@googlegroups.com
#26883: makemessages doesn't find blocktrans if it comes after a comment in
templates
-------------------------------------+-------------------------------------
Reporter: dAnjou | Owner: nobody
Type: Bug | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #21963.

--
Ticket URL: <https://code.djangoproject.com/ticket/26883#comment:4>

Reply all
Reply to author
Forward
0 new messages