-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Spurious spaces in code blocks when translated with Google Translate #5727
Comments
Unfortunately, I'm not good at google translate. Do you have any good idea? |
@astrofrog Could you point to a specific documentation page that is available online and specify the language you are translating to? This does not seem to be a problem that occurs always, no matter the type of code block and language. |
Hmm... google translate inserts a space character between |
I also had a look and could not find any straight-forward fix for this. I certainly see this as a problem with Google translate and not with Sphinx. It's probably technically possible to implement work-arounds in Sphinx (e.g.: writing a script that waits some seconds after page load, checks the URL and removes space characters in elements with specific classes), but these would be rather hacky and unreliable. |
I feel this is a problem of Google Translate. So there are nothing to do from sphinx side. In addition, workaround is fragile and hacky. So I don't think we should not that as sphinx-core. |
Makes sense imho. Then I mark it as |
In #4424, Sphinx introduced the
class='notranslate'
on code blocks, which is great and works to some extent. However, there is a residual issue that Google Translate appears to introduce spaces between parts of the code:which means that copy/pasted code can't actually be used without cleaning it up first. It would be great if this is something that could be prevented on the Sphinx side.
(cc-ing @tk0miya as the author of #4424)
The text was updated successfully, but these errors were encountered: