#15632 closed (fixed)
django-admin.py makemessages failure on ' symbol in templates comment block
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Internationalization | Version: | dev |
| Severity: | Keywords: | xgettext | |
| Cc: | steve@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
django-admin.py makemessages fails on mezzanine.core application default admin/base_site.html template (attachment:base_site.html)
$ django-admin.py makemessages -l ru processing language ru Error: errors happened while running xgettext on base_site.html ./templates/admin/base_site.html.py:15: warning: unterminated string ./templates/admin/base_site.html.py:16: warning: unterminated string ./templates/admin/base_site.html.py:21: warning: unterminated string
It caused by xgettext when it see "Mezzanine's" string in this lines. In django v1.2 error doesn't appears.
Attachments (4)
Change History (13)
by , 15 years ago
| Attachment: | base_site.html added |
|---|
comment:1 by , 15 years ago
comment:3 by , 15 years ago
comment:4 by , 15 years ago
| Keywords: | xgettext added |
|---|
Same situation with gettext 0.17.
[grad@grad-book core]$ LANG=C xgettext --version xgettext (GNU gettext-tools) 0.17 ... [grad@grad-book core]$ LANG=C PYTHONPATH=/home/grad/repos/django /home/grad/repos/django/django/bin/django-admin.py --version 1.3 rc 1 SVN-15876 [grad@grad-book core]$ LANG=C PYTHONPATH=/home/grad/repos/django /home/grad/repos/django/django/bin/django-admin.py makemessages -l ru processing language ru Error: errors happened while running xgettext on base_site.html ./templates/admin/base_site.html.py:15: warning: unterminated string ./templates/admin/base_site.html.py:16: warning: unterminated string ./templates/admin/base_site.html.py:21: warning: unterminated string [grad@grad-book core]$ LANG=C django-admin.py --version 1.2.5 [grad@grad-book core]$ LANG=C django-admin.py makemessages -l ru processing language ru [grad@grad-book core]$ echo $? 0
comment:5 by , 15 years ago
Is there any way to see content of ./templates/admin/base_site.html.py file? Does django any change in template before passing it to xgettext?
by , 15 years ago
| Attachment: | 15632-2.diff added |
|---|
Same patch which doesn't replace newlines (following ramiro's idea)
comment:6 by , 15 years ago
| Has patch: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
by , 15 years ago
| Attachment: | 15632-5.diff added |
|---|
New patch for the issue -- preseves line numbers in .po file comments, expanded tests
comment:7 by , 15 years ago
15632-5.diff is a further evolution of the patch we were discussing with Claude on IRC. I wasn't comfortable with ignoring the multi-line comments in templates because that means we get non-accurate line numbers #: path/to/template/file.html:NN comments in the PO files, so this patch also solves this. Tests were also expanded to cover some edge cases.
Which version of gettext do you use? Running
xgettext --versionshould give you that info.