Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#12320 closed (fixed)

Translations hints in HTML are lost in PO file

Reported by: 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: UI/UX:


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 claudep 6 years ago.
Translator comments in Django templates

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 7 years ago by 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 6 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by claudep

Translator comments in Django templates

comment:4 Changed 6 years ago by claudep

  • Has patch set
  • milestone set to 1.3

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

comment:5 Changed 6 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

(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 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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