You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When translating a English text with HTML elements to French, the response contains unexpected additional HTML Tags and often a full sentence that was not in the input.
To Reproduce
Minimal JS Script to reproduce the Error (last tested on March 9th 2024 6PM CET)
const deepl = require('deepl-node')
const authKey = "<authkey>"
const translator = new deepl.Translator(authKey)
async function translate(targetLang) {
const result = await translator.translateText('<p><strong>Testing the system</strong></p>', 'en', targetLang, tag_handling = 'html')
console.log(result)
}
translate('de')
translate('fr')
This results in the following responses:
{
text: '<p><strong>Test des Systems</strong></p>',
detectedSourceLang: 'en'
}
{
text: "</p><strong>Tester le système</strong></p><strong></p><strong>La mise en place d'un système de gestion de l'information est une priorité.",
detectedSourceLang: 'en'
}
The German translation is correct but the French translation has <strong></p><strong>La mise en place d'un système de gestion de l'information est une priorité. appended to a seemingly correct result.
I've noticed that without the <strong> Tag it does not happen but I have not tested that exhaustively.
Thank you very much.
The text was updated successfully, but these errors were encountered:
wilhelmberghammer
changed the title
Translating HTML with English text to Frech adds HTML Tags and full sentence that is not in the input text
Translating HTML with English text to French adds HTML Tags and full sentence that is not in the input text
Mar 9, 2024
@wilhelmberghammer I think your syntax is a bit off from the documentation. Try this, where tag_handling is converted to camelCase and passed inside of an "options" object.
const result = await translator.translateText(
'<p><strong>Testing the system</strong></p>',
'en',
targetLang,
{tagHandling: 'html'}
);
Describe the bug
When translating a English text with HTML elements to French, the response contains unexpected additional HTML Tags and often a full sentence that was not in the input.
To Reproduce
Minimal JS Script to reproduce the Error (last tested on March 9th 2024 6PM CET)
This results in the following responses:
The German translation is correct but the French translation has
<strong></p><strong>La mise en place d'un système de gestion de l'information est une priorité.
appended to a seemingly correct result.I've noticed that without the
<strong>
Tag it does not happen but I have not tested that exhaustively.Thank you very much.
The text was updated successfully, but these errors were encountered: