Code

Opened 4 years ago

Closed 3 years ago

Last modified 3 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:

Description

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

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 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 4 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 4 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

Changed 3 years ago by claudep

Translator comments in Django templates

comment:4 Changed 3 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 3 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 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.