#10234 closed (fixed)
makemessages.py SyntaxErrors are hard to track because they don't say which template or file it happened in
Reported by: | Peter Bengtsson | Owned by: | Andrew Badr |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | django-admin | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
I ran django-admin.py makemessages -l sv
and it turns out that I had forgotten the 'end' on {% endblocktrans %} so it threw this error:
SyntaxError: Translation blocks must not include other block tags: blocktrans
If you have many files with blocktrans in them it's hard to know where you've make the syntax error.
I patched makemessages.py to also include the filename into error message. Now the error message looks like this instead:
SyntaxError: Translation blocks must not include other block tags: blocktrans (file: ./search/templates/500.html)
Attachments (2)
Change History (8)
by , 16 years ago
Attachment: | makemessages.py.diff added |
---|
follow-up: 2 comment:1 by , 16 years ago
Noticed that when you download the .diff file or when you try to view it here on Trac it shows as just one line. Weird.
comment:2 by , 16 years ago
Patch needs improvement: | set |
---|
Replying to peterbe:
Noticed that when you download the .diff file or when you try to view it here on Trac it shows as just one line. Weird.
The patch contents looks mostly ok when you download it. Please generate it from the root of the django tree so the .diff header contains the django/core/management/commands/makemessages.py
path. Also, specify the -u (unified) to diff, this will solve the Trac display problem.
This is described at http://docs.djangoproject.com/en/dev/internals/contributing/#patch-style.
Thanks for you contribution!
comment:3 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
belongs in django/core/management/commands/