deepl-php
deepl-php copied to clipboard
Problem with HTML translation
Hello,
we use DeepL with tag_handling="html" but the problem is that output of html is changed e.g some of
tags are moved to other positions. How can we solve that we don't want to change any html entities and their positions.
Thanks
Experiencing this issue as well.
Example sentence (click on Continue to continue):
<p>Klik på <span translate="no">Continue</span> for at fortsætte</p>
When using the API library, the element is moved to the beginning (Continue Click to continue):
<p><span translate="no">Continue</span> Klicka för att fortsätta</p>
The API is called like this:
$lib->translateText($string, 'da', 'sv', ['tag_handling'=>'html'])
It seems to break on nested elements, so my workaround is to move the element outside, but of course this breaks the HTML structure..
<p>Klik på </p><span translate="no">Continue</span><p> for at fortsætte</p>
Can confirm this is happening. And it gets worse if you are using "don't translate" tags like <p translate="no">.
Tried reaching support with our account manager and they confirmed tag handling needs improvement on their end.
@osiris-mm any progress regarding this topic at all?
This is due to model issues and should be unrelated to the PHP library. We are working on a new and improved version of tag handling that should have fewer issues like this, but I can't promise a release date yet.