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

Ignore non-html interpolations in DeepL Translator #487

Closed
wants to merge 1 commit into from

Conversation

PolinaStamenova
Copy link

As described in DeepL xml docs ignore_tags can only be used when tag_handling=xml

It worked in the Spanish example, because it is not translating user in this context.

Screenshot 2023-01-23 at 18 34 35

We discovered this bug by translating a bigger project and it happened to more than the half of our translations.
As you can see we added regression test. Enabling xml does work in our code base without any side effects.

As described in [DeepL xml docs](https://www.deepl.com/docs-api/xml)
`ignore_tags` can only be used when `tag_handling=xml`

It worked in the Spanish example, because it is not translating user
in this context.

Co-authored-by: Jalyna Schröder <js@zaikio.com>
@glebm
Copy link
Owner

glebm commented Jan 23, 2023

I think this implies that the input to DeepL should be valid XML (or perhaps HTML), so you should also HTML-escape non-HTML values when sending them to DeepL and then HTML-unescape the results.

@davidwessman
Copy link
Collaborator

I just saw this PR after making my own :/
@glebm do you have examples of any values that we need to escape before sending to DeepL?

@davidwessman
Copy link
Collaborator

This is related to #417

@davidwessman
Copy link
Collaborator

@PolinaStamenova can you try it out on main now?

@glebm
Copy link
Owner

glebm commented Oct 14, 2023

Superceded by #523

@glebm glebm closed this Oct 14, 2023
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.

3 participants