Opened 8 years ago

Closed 8 years ago

#26883 closed Bug (duplicate)

makemessages doesn't find blocktrans if it comes after a comment in templates

Reported by: Max Ludwig Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Max Ludwig)

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

Change History (4)

comment:1 by Max Ludwig, 8 years ago

Description: modified (diff)

comment:2 by Ryan Castner, 8 years ago

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

comment:3 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted
Version: master

comment:4 by Claude Paroz, 8 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #21963.

Note: See TracTickets for help on using tickets.
Back to Top