deepl-php icon indicating copy to clipboard operation
deepl-php copied to clipboard

Wrong behavior with TranslateTextOptions::TAG_HANDLING xml and notranslate tag

Open VincentLanglet opened this issue 1 year ago • 4 comments

Hi @daniel-jones-deepl,

I discover another bug with the TranslateTextOptions::TAG_HANDLING => xml (But different from https://github.com/DeepLcom/deepl-php/pull/43#issue-2146235966)

Translating FR to ES

En seulement 4 mois, l’établissement a généré <strong wg-1="">30k€ de <notranslate>ingresos</notranslate></strong> et a enregistré <strong wg-2="">plus de 80 nouvelles réservations</strong> suite à l’envoi d’e-mails marketing personnalisés

En sólo 4 meses, el establecimiento generó <strong wg-1="">30k€ en <notranslate>ingresos</notranslate></strong> y registró <strong wg-2="">más de 80 nuevas reservas</strong> tras el envío de emails de marketing personalizados.

Translating FR to ES with TranslateTextOptions::TAG_HANDLING => xml

En seulement 4 mois, l’établissement a généré <strong wg-1="">30k€ de <notranslate>ingresos</notranslate></strong> et a enregistré <strong wg-2="">plus de 80 nouvelles réservations</strong> suite à l’envoi d’e-mails marketing personnalisés

<strong wg-1=""> <notranslate>ingresos</notranslate>En sólo 4 meses, el establecimiento generó</strong> <strong wg-1="">30.000 euros</strong> y registró <strong wg-1=""></strong> <strong wg-2="">más de 80 nuevas reservas</strong> tras el envío de correos electrónicos de marketing personalizados.

I would expect a result similar to the first one.

Could you confirm and forward the issue to your backend team ? Thanks.

VincentLanglet avatar May 23 '24 16:05 VincentLanglet

HI @VincentLanglet, thanks for the report. I was able to reproduce the problem by also setting ignore_tags to include notranslate tag. This is indeed a strange problem, some target languages (eg en-US) seem to handle it correctly, others have a similar problem. I've forwarded it to our backend team.

daniel-jones-dev avatar May 24 '24 13:05 daniel-jones-dev

Same problem with German to Polish language pair

myfbone avatar Jul 17 '24 13:07 myfbone

Same here, please fix it asap 🙏

ricardoaraujo330 avatar Aug 13 '24 06:08 ricardoaraujo330

Same thing happens in html using "don't translate" tags as per the documentation: <p translate="no">My first paragraph.</p>.

When these tags are present, translation becomes inconsistent. It removes blank spaces between words and doesn't seem to understand the context around the tagged words.

osiris-mm avatar Jan 07 '25 08:01 osiris-mm