Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibilty to use CDATA instead of encoding entities #21

Open
liayn opened this issue Feb 14, 2023 · 3 comments
Open

Possibilty to use CDATA instead of encoding entities #21

liayn opened this issue Feb 14, 2023 · 3 comments

Comments

@liayn
Copy link

liayn commented Feb 14, 2023

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
Copy link
Owner

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
Copy link
Author

liayn commented Feb 22, 2023

Thanks, I already suspected this to be the case.

@alexander-nitsche-governikus

I just installed your tool and use it via PhpStorm which works fine. Thanks! I stumbled upon the CDATA problem too and wonder if a solution could be:

(1) Add a checkbox field "CDATA" per row.
(2) On loading the Xliff file, set the state of the field according to the Xliff file.
(3) On saving to the Xliff file, compile the whole form once with CDATA and once without CDATA and per row pick the variant based on the checkbox.

I think, having CDATA support would be a great benefit, and compiling the form twice might be an effort that is worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants