deepl-php
deepl-php copied to clipboard
Wrong behavior with TranslateTextOptions::TAG_HANDLING xml and notranslate tag
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.
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.
Same problem with German to Polish language pair
Same here, please fix it asap 🙏
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.