Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#12320 closed (fixed)

Translations hints in HTML are lost in PO file

Reported by: Torsten Bronger Owned by: nobody
Component: Internationalization Version: 1.1
Severity: Keywords:
Cc: bronger@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently, all translation hints ("extracted comments" in xgettext speak) in HTML files get lost because xgettext interprets HTML files as Python sources and doesn't know {# ... #} or <!-- ... -->.

Therefore, django.utils.translation.trans_real.templatize should convert HTML/Template comments to Python comments.

Attachments (1)

mark_template_comments.diff (4.9 KB) - added by Claude Paroz 9 years ago.
Translator comments in Django templates

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by Ramiro Morales

If you are asking for context comments the #10004 is tracking adding that feature.

comment:2 Changed 10 years ago by Torsten Bronger

No. Even if gettext parses comments at all, it would miss those in HTML files because django.utils.translation.trans_real.templatize must convert them to a format which can be understood by gettext.

comment:3 Changed 10 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

Changed 9 years ago by Claude Paroz

Attachment: mark_template_comments.diff added

Translator comments in Django templates

comment:4 Changed 9 years ago by Claude Paroz

Has patch: set
milestone: 1.3

Proposed patch uploaded. Note that it properly applies only on top of #10004 patch.

comment:5 Changed 9 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [14595]) Fixed #10004 and #12320 -- Enabled the makemessages management command to collect comments for translators that start with the "Translators" keyword. Thanks for the report and patches, martinb and Claude Paroz.

comment:19 Changed 8 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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