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

xliff export import problems #163

Closed
antton opened this issue Mar 16, 2017 · 2 comments
Closed

xliff export import problems #163

antton opened this issue Mar 16, 2017 · 2 comments
Assignees

Comments

@antton
Copy link

antton commented Mar 16, 2017

Hi,

The xliff export-import function has some problems when we use javascript code in any idevice.

For example if we write the following easy function.

<script type="text/javascript">// <![CDATA[
function programa(sw) {
var pic;
var testua;
switch (sw) {
    case 0:
        pic = "MCN04_AUX_R09_00_SolucionModales.png";
	testua = "<h1>hola</h1>";
        break;
    case 1:
        pic = "MCN04_AUX_R09_N20_SolucionModales.png";
	testua = "<h1>hola2</h1>";
        break;
    case 2:
        pic = "MCN04_AUX_R09_N30_SolucionModales.png";
	testua = "<h1>hola3</h1>";
        break;
   
}
document.getElementById('myImage').src = pic;
document.getElementById('codea').innerHTML = testua;

}
// ]]></script>

It return the following function to the new import idevice.

<script type="text/javascript">// &lt;![CDATA[
function programa(sw) {
var pic;
var testua;
switch (sw) {
    case 0:
        pic = &quot;MCN04_AUX_R09_00_SolucionModales.png&quot;;
	testua = &quot;&lt;h1&gt;hola&lt;/h1&gt;&quot;;
        break;
    case 1:
        pic = &quot;MCN04_AUX_R09_N20_SolucionModales.png&quot;;
	testua = &quot;&lt;h1&gt;hola2&lt;/h1&gt;&quot;;
        break;
    case 2:
        pic = &quot;MCN04_AUX_R09_N30_SolucionModales.png&quot;;
	testua = &quot;&lt;h1&gt;hola3&lt;/h1&gt;&quot;;
        break;

}
document.getElementById('myImage').src = pic;
document.getElementById('codea').innerHTML = testua;

}
// ]]&gt;</script>

As we can see it escape all the html entities with something like (htmlentities in PHP) but it doesn't reformat again with something like (html_entity_decode in PHP) to make it work properly then.

Would be nice to fix it ;)

@antton
Copy link
Author

antton commented Mar 24, 2017

It looks like the problem could be when you export the content wrapping on CDATA and you try to import it again, the CDATA of the javascript code is inside the content general CDATA and the parses never looks for that part so it let it "broken".

I hope someone could check it!

@ignaciogros
Copy link
Collaborator

@JuanCasanovaSdweb:

I think it's just as @antton says: eXe should replace those entities (<...) with the original code (<...).

They're using XLIFF to translate many contents, and TinyMCE adds CDATA automatically, so solving this might be important for some projects.

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