-
Notifications
You must be signed in to change notification settings - Fork 22
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
XML tags with attributes change the order of the translation when tagHandling is XML but are OK when tagHandling is off #30
Comments
Seems like a standard XML must have a space between name and attribute, so I guess the source could be the problem. |
I think the problem with this XML example is that you are using a tag (
This is a valid XML document (I added an attribute
|
@JanEbbing That is correct, however there is an issue when there is an This example could demonstrate the problem :
where
Whereas it should be:
Meaning that the Any ideas for this problem? |
Putting the exclamation mark outside the
|
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. |
Describe the bug
I am translating a text using Deepl API that contains XML tags and some of these tags include custom attributes; ex.
That’s the <fontcolor="#007af2">timer</fontcolor>! It measures the time you spend in a module OR the time you have left to complete a challenge!
However, the format of the XML tag is not conserved when the text is translated to Slovenian and Italian (I have not tested in other languages but could be the case for others as well). The result is like this:
Slovenian:
To je časovnik <fontcolor="#007af2"></fontcolor> ! Meri čas, ki ga porabite v modulu, ALI čas, ki vam je ostal do konca izziva!
Italian:
Questo è il timer <fontcolor="#007af2"></fontcolor> ! Misura il tempo trascorso in un modulo O il tempo rimasto per completare una sfida!
Meaning that instead of putting the word
timer
inside the tag, it gets out and leaves the tag empty. This happens when thetagHandling
option is set to eitherXML
orHTML
, however if I set thetagHandling
tooff
, the result is OK but other problems occur for my text because thetagHandling
is set tooff
.To Reproduce
Steps to reproduce the behavior:
Can be reproduced in the Deepl API Simulator: https://www.deepl.com/en/docs-api/simulator/
That’s the <fontcolor="#007af2">timer</fontcolor>! It measures the time you spend in a module OR the time you have left to complete a challenge!
in the Text field.Expected behavior
The correct text should be:
Slovenian:
To je <fontcolor="#007af2">časomer</fontcolor>! Meri čas, ki ga porabite v modulu, ALI čas, ki vam je ostal za dokončanje izziva!
Italian:
È il <fontcolor="#007af2">timer</fontcolor>! Misura il tempo trascorso in un modulo O il tempo rimanente per completare una sfida!
Which is the case when the
tagHandling
is set tooff
but that should not be the case.What has been tested
I tried combining different options together to see if I can make it work but none of them gave me the intended result. These are the parameters that I changed:
SentenceSplitting=on,off,noNewLines
preserveFormatting=on,off
nonSplittingTags=fontcolor,null
UPDATE 07/10/2023 11:47 AM
The problem seems to be the fact that the API takes into account the
="#007af2"
part of the tag as the name of the tag and it doesn't see the closing tag for the same thing. So if we add a space:<fontcolor "=#007af2">
, it will work as expected. I don't know if a fix for that would be necessary but maybe a support for custom attributes like this would be nice.The text was updated successfully, but these errors were encountered: