Bug 130425 - Can't embed HTML in localized strings
Summary: Can't embed HTML in localized strings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Network
Classification: Red Hat
Component: RHN/R&D
Version: RHN Devel
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ryan Bloom
QA Contact: Fanny Augustin
URL:
Whiteboard:
Depends On:
Blocks: rhnMilestone1
TreeView+ depends on / blocked
 
Reported: 2004-08-20 13:37 UTC by Ryan Bloom
Modified: 2007-04-18 17:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-24 13:18:57 UTC


Attachments (Terms of Use)

Description Ryan Bloom 2004-08-20 13:37:42 UTC
Because we are using XML for storing our localized strings, you can't
embed HTML in the localized version of the string.  If you try to use
straight HTML, the XML parser gets confused, and only includes the
part of the string within HTML tags.  For example:

    <msg id="message.defaultSystemGroups">Default system groups
updated for<strong>HA HA</strong></msg>

Will resolve to "HA HA".  If you escape the HTML and use:

    <msg id="message.defaultSystemGroups">Default system groups
updated for&lt;strong&gt;HA HA&lt;/strong&gt;</msg>

This resolves to: "Default system groups updated for <strong>HA
HA</strong>

Neither of these is correct.  I need the <strong>/</strong> to be
unescaped when printed in the HTML stream.

Comment 1 Mike McCune 2004-08-20 16:10:17 UTC
Use CDATA around the body of the tag:

for example:

    <msg id="errors.header"><![CDATA[<div
class="local-alert"><ul>]]></msg>

Feel free to close this bug if this works for you.  It definitely
works for me and was my intention to use CDATA for all messages that
contain XML or HTML.



Comment 2 Jesus M. Rodriguez 2004-08-23 21:50:12 UTC
CDATA should most definitely work.  I suggested this to Ryan last week.

Comment 3 Ryan Bloom 2004-08-24 13:18:57 UTC
Turns out it is a combination of CDATA and telling the JSP to not
escape the xml tags.  Fixed now.


Note You need to log in before you can comment on or make changes to this bug.