humhub / translator-issues

NonFree Module - Issue Tracker Only
0 stars 0 forks source link

Translation of Links broken #10

Closed sebastianSchmidt86 closed 6 months ago

sebastianSchmidt86 commented 6 months ago

How to reproduce:

the translation looks like this in the frontend:

image

Expected behaviour is this:

image
luke- commented 6 months ago

@sebastianSchmidt86 Do I understand correctly that the problem is that the DeepL API returns encoded quotes?

Maybe there is an option that DeepL does not encode here?

sebastianSchmidt86 commented 6 months ago

I just saw that the original text is stored with encoded quotes and is being sent to DeepL/Google incorrectly.

Instead of Test message with [Link](https://www.google.at "Link") this is sent to Deepl/Google Test message with [Link](https://www.google.at "Link")

Maybe we should use $event->sender->text instead of $event->sender->content in Events.php

yurabakhtin commented 6 months ago

@sebastianSchmidt86 @luke- I see a difference between $event->sender->text and $event->sender->content here https://github.com/humhub/humhub/blob/master/protected/humhub/modules/content/widgets/richtext/ProsemirrorRichText.php#L143-L148 so the content may has some preparations from extenssions side, so I have decided to keep it there but added Html::decode(). PR https://github.com/humhub/translator/pull/40.