Localize Text in an XData Block
Hi everyone!
I am trying to localize text in an XData block using the $$$Text macro. A snippet of code is included below. Is there an easy way to localize the text included in an XData block? So far, using the $$$Text macro is not working; when I export the %MessageDictionary, the text to be localized isn't included in the export.
{
<body>
<p>
Text to be translated into another language
</p>
</body>
}
Thank you in advance!
Product version: IRIS 2020.3
If the string variable 'stra' contains the XData bloc.
The tags '<p>' and '</p>' must be in lowercase.
Hi Erica,
$$$Text generates content into the message globals at compile time. Here's one way to solve the problem:
After compilation you'll have:
If you want to localize individual strings in the XData block independent of the HTML markup that gets a little more complicated. I'd think it's simpler/possibly better to localize the entire block at once though.
One note here, $$Quote^%qcr will represent control characters with $c(decimalAsciiCode) syntax - like the newlines in this case. I think there's some more official classmethod that's equivalent, but I don't recall where it is off the top of my head.