Giter Site home page Giter Site logo

XML tags with attributes change the order of the translation when tagHandling is XML but are OK when tagHandling is off about deepl-node HOT 5 OPEN

deeplcom avatar deeplcom commented on June 7, 2024
XML tags with attributes change the order of the translation when tagHandling is XML but are OK when tagHandling is off

from deepl-node.

Comments (5)

JanEbbing avatar JanEbbing commented on June 7, 2024 1

I think the problem with this XML example is that you are using a tag (fontcolor) as an attribute, which is not allowed. The following is an invalid XML document (you can check with various online validators/the XML standard)

<?xml version = "1.0" encoding = "UTF-8"?>
<note>
That’s the <fontcolor="#007af2">timer</fontcolor>!
</note>

This is a valid XML document (I added an attribute col with your color):

<?xml version = "1.0" encoding = "UTF-8"?>
<note>
That’s the <fontcolor col="#007af2">timer</fontcolor>!
</note>

from deepl-node.

imanirajdoost avatar imanirajdoost commented on June 7, 2024 1

You're right, in this case it will resolve the problem, I suspect that there will be other examples having the same issue, I'll make sure to add them here if I find them to help the team resolve the issue.

from deepl-node.

imanirajdoost avatar imanirajdoost commented on June 7, 2024

Seems like a standard XML must have a space between name and attribute, so I guess the source could be the problem.

from deepl-node.

imanirajdoost avatar imanirajdoost commented on June 7, 2024

@JanEbbing That is correct, however there is an issue when there is an ignoreTag inside another XML tag (which from the XML standard point of view, should be valid).

This example could demonstrate the problem :

Welcome back to the <gs><ignore>[SCHOOL_NAME]</ignore>!</gs> We missed you! Are you ready for this path?

where ignore is added to the ignoreTags list. In this case the result in Slovenian is :

Dobrodošli nazaj na <gs><ignore>[SCHOOL_NAME]</ignore>! Pogrešali smo vas! Ste pripravljeni na to pot?</gs>

Whereas it should be:

Dobrodošli nazaj na <gs><ignore>[SCHOOL_NAME]</ignore>!</gs> Pogrešali smo vas! Ste pripravljeni na to pot?

Meaning that the <gs> tag is not well-placed. Again, if we set tagHandling to off, the <gs> tag will be in its place but the [SCHOOL_NAME] is translated because the tagHandling would not work anymore.

Any ideas for this problem?

from deepl-node.

JanEbbing avatar JanEbbing commented on June 7, 2024

Putting the exclamation mark outside the gs tag fixes this for me (I assume this is because we do sentence splitting, and the exclamation mark that ends this sentence is inside the XML tag), maybe that helps?

Welcome back to the <gs><ignore>[SCHOOL_NAME]</ignore></gs>! We missed you! Are you ready for this path?
=>
Dobrodošli nazaj v <gs><ignore>[SCHOOL_NAME]</ignore></gs>! Pogrešali smo te! Ste pripravljeni na to pot?
But I agree this is not a good response from our API, I will check internally with another team.

from deepl-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.