Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix: Implement smarter reference comparison for i18n
  • Loading branch information
dariomesic committed Oct 28, 2025
commit 6a64afad537b064d70ffed406bbfdd0c317d6593
7 changes: 3 additions & 4 deletions sphinx/transforms/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ def compare_references(
warning_msg: str,
) -> None:
"""Warn about mismatches between references in original and translated content."""
# FIXME: could use a smarter strategy than len(old_refs) == len(new_refs)
if not self.noqa and len(old_refs) != len(new_refs):
old_ref_rawsources = [ref.rawsource for ref in old_refs]
new_ref_rawsources = [ref.rawsource for ref in new_refs]
old_ref_rawsources = [ref.rawsource for ref in old_refs]
new_ref_rawsources = [ref.rawsource for ref in new_refs]
if not self.noqa and old_ref_rawsources != new_ref_rawsources:
logger.warning(
warning_msg.format(old_ref_rawsources, new_ref_rawsources),
location=self.node,
Expand Down
Loading