garfieldius / t3ll

Simple tool for editing TYPO3 localization files
MIT License
44 stars 0 forks source link

Possibilty to use CDATA instead of encoding entities #21

Open liayn opened 1 year ago

liayn commented 1 year ago

Is it possible to create CDATA blocks instead of xml encoding the text? This would be a bit nicer to read.

Example:

<trans-unit id="cart.vatId_needed" resname="cart.vatId_needed">
  <source><![CDATA[A valid EU VAT ID is required for invoicing. Please store this in your user profile: <a class="btn btn-gray" href="%1$s">Edit Profile</a>]]></source>

vs

<trans-unit id="cart.vatId_needed" resname="cart.vatId_needed">
  <source>A valid EU VAT ID is required for invoicing. Please store this in your user profile: &lt;a class=&#34;btn btn-gray&#34; href=&#34;%1$s&#34;&gt;Edit Profile&lt;/a&gt;</source>
garfieldius commented 1 year ago

I heard this before, unfortunately it is not a trivial task. t3ll uses the encoding/xmlpackage of the go stdlib, which does not support this, at least not currently. It either always uses CDATA or never, there is no direct way to do this conditionally, depending on the actual content.

Will keep the issue open in case I find a not-too-weird workaround to get this working.

liayn commented 1 year ago

Thanks, I already suspected this to be the case.