Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1962 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] google_translate in admi18n needs to decode HTML escape sequences

Reported by: jbinney Owned by: anonymous
Priority: normal Milestone: 1.1b1
Component: TurboGears Version: 1.0.5
Severity: normal Keywords: google_translate html escape
Cc:

Description

Since the google_translate function reads and selects raw HTML code, it needs to convert the HTML escape sequences (e.g. &#39; or &amp;#39;) to their corresponding unicode representations. I solve this issue by retooling some code from Leif K-Brooks ( link) to decode the escape sequences twice, handling both escape sequence formats. This patch applies to utils.py, which is located in <turbogears>/i18n/.

Attachments

utils.patch Download (1.1 KB) - added by jbinney 11 years ago.

Change History

Changed 11 years ago by jbinney

comment:1 Changed 11 years ago by Chris Arndt

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from 1.0.x bugfix to 1.1 beta 1

Fixed in r5343 for the 1.1 branch and made the i18n.google_translate function a bit more robust. Since this is a non-trivial fix, it will not go into the 1.0 branch anymore.

Ported to 1.5 branch in r5344.

Note: See TracTickets for help on using tickets.