Bug 130425
| Summary: | Can't embed HTML in localized strings | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Network | Reporter: | Ryan Bloom <rbb> |
| Component: | RHN/R&D | Assignee: | 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: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 125080 | ||
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.
CDATA should most definitely work. I suggested this to Ryan last week. Turns out it is a combination of CDATA and telling the JSP to not escape the xml tags. Fixed now. |
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<strong>HA HA</strong></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.