WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.49k stars 993 forks source link

Add check for Sphinx/RST syntax #8446

Open rffontenelle opened 1 year ago

rffontenelle commented 1 year ago

Describe the issue

I've been translating Weblate Docs for sometime and one issue I've always came across was Sphinx roles incorrectly rendered because of translation mistakes. These mistakes are not reported for the translator (i.e. they were not catch by quality checks), so they might not be noticed by the translator when translation several strings.

I already tried

Steps to reproduce the behavior

  1. Go to '...'
  2. Scroll down to '...'
  3. Click on '...'
  4. See error

Expected behavior

For the translator to be (automatically) notified of mistakes in Sphinx role translations that trigger WARNING: and ERROR: when building and that are incorrectly rendered in the translated documentation.

Screenshots

Here is an example from pt_BR translation of installation in Debian page of Sphinx role :command:`weblate` incorrectly translated as :comando:`weblate` and being rendered like that.

Role incorrectly translated as "comando"

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

How I found these translation mistakes?

I browsed the build logs of weblate-pt-br at readthedocs and found interesting information.

  1. https://readthedocs.org/projects/weblate-pt-br/builds/
  2. Entered the latest finished build (#18844887, in my current case)
  3. In the specific build page, clicked See raw
  4. In the raw logs, rolled down until I found reading sources... [100%]
  5. Now, Sphinx's WARNINGS: and ERRORS: start
    NOTE: The errors/warnings always shows <filepath>:<linenumber>, e.g. home/docs/checkouts/readthedocs.org/user_builds/weblate-pt-br/checkouts/latest/docs/admin/auth.rst:676. The useful part is admin/auth.rst:676.

  6. On the Weblate Documentation component, I found the string using the search filter location: (e.g. location:admin/auth.rst:676)

Some examples of issues (removed the file fullpath, keeping only after docs/):

github-actions[bot] commented 1 year ago

This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented.

In case you need this feature soon, please consider helping or push it by funding the development.