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

Respect rte allow tags in translate request #288

Draft
wants to merge 1 commit into
base: 3.0
Choose a base branch
from

Conversation

NarkNiro
Copy link
Member

@NarkNiro NarkNiro commented Jul 21, 2023

With this change the RTE configuration is determined from the field to be translated. To give deepl a list of allowed HTML tags.
To allow a correct separation in the translated text with HTML tag.

Resolve #278

@NarkNiro NarkNiro requested a review from calien666 July 21, 2023 16:10
@NarkNiro NarkNiro requested a review from sbuerk July 21, 2023 16:17
Classes/Resolver/RichtextAllowTagsResolver.php Outdated Show resolved Hide resolved
Classes/Resolver/RichtextAllowTagsResolver.php Outdated Show resolved Hide resolved
Classes/Resolver/RichtextAllowTagsResolver.php Outdated Show resolved Hide resolved
Tests/Functional/Services/DeeplServiceTest.php Outdated Show resolved Hide resolved
Classes/Domain/Dto/TranslateOptions.php Show resolved Hide resolved
Classes/Hooks/TranslateHook.php Show resolved Hide resolved
@joey-bolts
Copy link

joey-bolts commented Jul 25, 2023

At first the PR was working for my case. However with some more testing i encountered the following.

I have bodytext with the text:

<p>cheese &amp; sausage</p>

I did a test case with a glossary (replace words with my and colleagues name):

cheese with NL translation = 'joey'
sausage with NL translation = 'arno'

the translation result was:

<p>kaas &amp; jam; arno</p>

Something still seems to be incorrect here.

Edit:

Adding $content = htmlentities($content); just before the translate request fixes this.

@NarkNiro NarkNiro force-pushed the wv_deepletranslate-278 branch from 36b8c00 to c888183 Compare July 28, 2023 15:32
With this change the RTE configuration is determined from the field to be translated.
To give deepl a list of allowed HTML tags.
To allow a correct separation in the translated text with HTML tag.
@NarkNiro NarkNiro force-pushed the wv_deepletranslate-278 branch from c888183 to 2187a72 Compare July 28, 2023 15:39
@NarkNiro NarkNiro requested a review from sbuerk July 28, 2023 15:44
@sbuerk sbuerk changed the base branch from main to 3.0 May 2, 2024 13:29
@NarkNiro NarkNiro marked this pull request as draft May 27, 2024 10:23
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

Successfully merging this pull request may close these issues.

[BUG] Spaces removed in translation request.
4 participants