Wiki 17.1 – Machine Translation Extension Breaks Embedded Macros and Images

Hello,

I am using XWiki version 17.1 with the Machine Translation extension enabled, and I’m facing a serious issue with how it handles embedded macros and inline HTML during translation.

When a page is translated, macros that are present in the original source text are corrupted and replaced by internal marker constructs, making the translated page unusable.

Original source (works correctly)

{{html}}
<span style="border-radius:4px;font-size:100%;font-weight:bold;background-color:#17a2b8;" 
      class="badge bg-info">APF</span>
{{/html}}

After machine translation, it becomes something like:

<!~-~-startmacro:html|-||-|<\span style="border-radius:4px;font-size:100%;font-weight:bold;background-color:#17a2b8;" class="badge bg-info">APF<\/span>~-~-> 
“ gedrückt werden. 
<!~-~-stopmacro~-~->

Original source (wth image on the page)

[[image:attach:image2024-12-29_11-0-45.png||width="800"]]

After machine translation

<!~-~-startimage~:true|-|attach|-|image2024-12-29_11-0-45.png~-~->[[image:/xwiki/bin/download/XWiki/MachineTranslation/MachineTranslationService/image2024-12-29_11-0-45.png?width=800||alt="image2024-12-29_11-0-45.png" width="800"]]<!~-~-stopimage~-~->*

Problem

  • Built-in macros such as {{html}} are not preserved

  • Inline HTML content is escaped and wrapped into <!~-~-startmacro ... ~-~-> markers

  • The resulting page source is invalid and macros no longer render

  • This happens even though the macro content itself should not be translated

Expected behavior

  • Macros ({{html}}, {{image}}, etc.) should remain unchanged

  • Only human-readable text should be passed to the translation engine

  • Page syntax and macros must be preserved exactly

Is there a configuration or workaround to prevent macros from being altered? Thank you for your help.