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

[BUG] Words directly followed by opening HTML tags get trashed during translation #311

Open
henner79 opened this issue Dec 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@henner79
Copy link

henner79 commented Dec 6, 2023

Describe the bug
Whenever a content element is translated via wv_deepltranslate / DeepL, words that have an opening HTML tag directrly behind them (no whitespace) get trashed in a specific way. In our case, product names are followed by a superscript registered trademark sign. In the translation, the whole product name is superscript as well!

To Reproduce

Create a content element (e.g. CType 'text') and add this to the field 'header' or 'bodytext' (code view):
Try the new FOOBAR<sup>®</sup> now!

Translate it to a language of your choice. The result looks like this:
Probieren Sie das neue <sup>FOOBAR®</sup> jetzt!
(the whole product name is superscript now - this means lots of "postprocessing" for us)

Expected behavior
We expected the translation to look like this:
Probieren Sie das neue FOOBAR<sup>®</sup> jetzt!

Side info: Product names within text are generally not translated in our case.

TYPO3 Setup

  • TYPO3 Version 11.5.23
  • PHP version 7.4
  • Extension version 3.0.5
  • DeepL PAID API
  • composer setup

Additional context
We did some debugging an figured out that the result returned from the DeepL API already contains the error. We contacted the DeepL support (we are a paying client). They took 3 months (!) for a reply, stating that they could not do much about it. However, they had some suggestions like putting a whitespace between the product name and the registered trademark (which is no option for us, and no "solution" anyway). And they suggested the use of placeholder tags like <placeholder suptext="®" /> during translation.

Suggestion
Maybe, some workaround for such cases could be added to wv_deepltranslate - e.g. by using the "placeholder" tags suggested by the DeepL support (see last paragraph). They could be added dynamically before the translation, then removed thereafter?

@henner79 henner79 added the bug Something isn't working label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant