Bug 130425

Summary: Can't embed HTML in localized strings
Product: Red Hat Network Reporter: Ryan Bloom <rbb>
Component: RHN/R&DAssignee: Ryan Bloom <rbb>
Status: CLOSED CURRENTRELEASE QA Contact: Fanny Augustin <fmoquete>
Severity: medium Docs Contact:
Priority: medium    
Version: RHN Devel   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-24 13:18:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 125080    

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.