Skip to content

rst-syntax incorrectly flags valid Sphinx gettext strings ending in :: #23008

Description

@leevincent

Describe the issue

Hi Weblate team, I found 12 strings in the Traditional Chinese (zh_Hant) Documentation component that are marked as needing editing because of this enforced check:

Literal block expected; none found.

In the original reStructuredText document, each affected paragraph introduces a literal block with ::. Sphinx extracts the paragraph as a gettext message, and the block that follows is outside that message. When Weblate checks the paragraph on its own, it reports that the block is missing. After the translation is uploaded, the enforced check marks it as needing editing again. Example translation unit · Original paragraph and JSON example

Steps to reproduce

  1. Extract gettext messages with Sphinx from an .rst document containing this paragraph and literal block:

    The manifest looks like this::
    
       {"schemaVersion": 1}
  2. Import the catalog into Weblate with rst-text enabled and rst-syntax configured as an enforced check.

  3. Translate the extracted paragraph, keeping the trailing ::, and save it.

  4. The check reports Literal block expected; none found. and marks the translation as needing editing.

I also reproduced the warning locally by passing the same English paragraph as both the source and the target to RSTSyntaxCheck.check_single(). The warning disappears when the following JSON block is included. A Sphinx 8.2.3 build of the original excerpt with the translation also passed with warnings treated as errors and rendered the JSON block correctly.

Expected behavior

When a literal block follows the paragraph in the source document but falls outside the extracted gettext message, keeping the original :: should pass the syntax check. A valid translation should stay marked as translated.

Environment

  • Hosted Weblate, Weblate / Documentation / Traditional Chinese (zh_Hant), gettext PO
  • Local reproduction with Docutils 0.21.2 and Weblate commit 41c9ab6
  • The exact Hosted Weblate version is unconfirmed.

Thanks for taking a look!

Activity

  1. added theissue type on Nov 20, 2026
  2. added this to the 2026.12 milestone on Nov 20, 2026
  3. added
    Waiting for: Triage
    Waiting for: Implementation
    and removed
    Waiting for: Triage
    on Nov 20, 2026
  4. added
    Waiting for: Release
    and removed
    Waiting for: Implementation
    on Nov 24, 2026
  5. github-actions commented on Nov 24, 2026

    @github-actions

    Thank you for your report — the issue has now been resolved.

    The fix has been merged into the repository and will be included in the upcoming Weblate 2026.12 release.

    • If you encounter any issues with the fix, please comment in this thread.
    • If you experience a similar but separate issue, open a new report so we can track it properly.
    • If you find Weblate helpful, consider supporting its development.
  6. added a commit that references this issue on Nov 24, 2026
    e2894ec
  7. added a commit that references this issue on Nov 28, 2026
    c9ce1ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Quality checksWaiting for: Release

    Type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions