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

Problem with HTML translation #48

Open
romanmuska opened this issue May 30, 2024 · 1 comment
Open

Problem with HTML translation #48

romanmuska opened this issue May 30, 2024 · 1 comment

Comments

@romanmuska
Copy link

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

@FPDK
Copy link

FPDK commented Nov 19, 2024

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>

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

2 participants