Edgewall Software

Opened 15 years ago

Closed 15 years ago

#358 closed defect (fixed)

small extraction problem with i18n:msg

Reported by: cboos Owned by: cmlenz
Priority: major Milestone: 0.6
Component: Internationalization Version: 0.5.1
Keywords: i18n:msg Cc:

Description

Noticed that on Trac trunk today, while adding <i18n:msg> elements in ticket.html. If the content of such element ends with a closing tag and there's no text or space between the two closing tags, then the [...] group in the extracted message will be truncated.

e.g.

<i18n:msg>A <a>link</a></i18n:msg>

will be extracted as:

msgid = "A [1:link"

Note that the problem doesn't happen when the i18n:msg attribute is used instead of the <i18n:msg> element, but I'll add a test for that case as well, for completeness.

I'm not 100% confident about the fix (why was END a special case here in the first place?), but at least there's no regression in the Genshi test suite and the Trac extraction and translation still works fine.

Attachments (1)

i18n_msg-element-no-newline.patch (3.3 KB) - added by cboos 15 years ago.
Fix the issue by removing the special case when the last seen element is an END token.

Download all attachments as: .zip

Change History (3)

Changed 15 years ago by cboos

Fix the issue by removing the special case when the last seen element is an END token.

comment:1 Changed 15 years ago by palgarvio

Well, if no tests were broken with the fix. It's good to go. I don't remember why that if was placed there anymore.

Want me to check in those changes?

comment:2 Changed 15 years ago by cmlenz

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

Patch applied in r1092. Thanks!

Note: See TracTickets for help on using tickets.