The “website translator” (js-proxy replacement) removes spaces. This was reported (by me) back in 2023 and fixed (JS Proxy translator sometimes removes spaces)… but apparently the fix never made it to the new website translator. The issue is much more severe than the previous bug though. Does anyone besides me use this product? I can’t imagine how this even made it through QA.
This happens before and after links and bold text from what I have noticed. It is not consistent on where it happens or if it happens. The following screenshots are all from https://docs.lizardbyte.dev/latest/developers/contributing.html (which is a sphinx docs project).
When the Website Translator prepares text for translation, it normalizes the whitespace around it, and when the text goes back into the page that spacing should be restored exactly as it was. In several markup shapes it currently is not, so the single space between a text fragment and the element next to it goes missing. Links, bold text and inline code are where a sentence gets split into separate fragments, so that is where you see it.
Whether a space survives depends on how the HTML around that sentence is formatted, which is why it looks inconsistent, and nothing in your project setup feeds into it, which is why both LizardByte projects behave the same way. The code blocks are a related aspect of the same handling: inside highlighted code each token sits in its own element, and our protection for preformatted content recognizes only the outer container, so indentation and line breaks between tokens get collapsed.
We are improving (CN 67635) this so that spacing around every translated fragment is preserved as it appears in the page source, and so highlighted code is treated as preformatted at every level. I would rather not give you a date I am not sure of, so I will come back to you once it reaches production.
For what it’s worth, I was able to workaround the issue in https://github.com/LizardByte/shared-web/pull/328
I used GPT5.6 Sol to resolve it. It initially tried with a cleanWhitespace argument which I believe your underlying framework supports, but the website translator object does not. So then it resorted to a callback. With the callback approach there was initially some race conditions, but it eventually worked it out.
I didn’t really want to to put this hack in, but I needed to do something as this bug makes everything look sloppy and unprofessional.
Hi @ReenigneArcher We’re glad to hear that you’ve found a workaround and managed it to work. Once the mentioned before task is finished, we’ll let you know right away
Looks like I can’t edit my last message, but I wanted to share a follow up PR that was also required. This was needed to preserve line breaks, and not just spaces. https://github.com/LizardByte/shared-web/pull/330