Treat markup as translatable with SoyMsgExtractor

62 Views Asked by At

Is there a way to have HTML markup inside {msg} not turned into placeholders when using SoyMsgExtractor?

Say I have some documentation:

{msg desc="Document X, can contain HTML markup"}
   <p>Foo bar baz</p>
   <p>Blah <b>blah</b> blah</p>
{/msg}

And I want the translatable message to contain the HTML markup rather than having it turned into placeholders. I.e. I'd like the generated XLIFF to read:

<source>&lt;p&gt;Foo bar baz&lt;/p&gt;&lt;p&gt;Blah &lt;b&gt;blah&lt;/b&gt; blah&lt;/p&gt;</source>

or

<source><![CDATA[<p>Foo bar baz</p><p>Blah <b>blah</b>blah</p>]]></source>

rather than

<source><x id="START_PARAGRAPH"/>Foo bar baz<x id="END_PARAGRAPH"/><x id="START_PARAGRAPH"/>

That way, translators can really feel free to split or merge paragraphs, add bold or italics, etc.

Additionally, it'd probably make the msg processing easier and possibly faster.

0

There are 0 best solutions below