From 5fd352c0476c5b62f1906d3fc0e7b53b6fb6a34f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 21:12:10 +0000 Subject: [PATCH 1/7] Initial plan From 90bcb69be3a38a12e1ef48c00e79a5218d2bf315 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 21:23:09 +0000 Subject: [PATCH 2/7] Fix false positive warnings for translated display text in references - Modified update_refnamed_references() to only check reference count, not display text - This allows translators to change display text while keeping the same target - Added comprehensive test case covering cases 2-4 from issue #14162 - Case 5 (glossary terms) already works correctly with explicit target syntax Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com> --- sphinx/transforms/i18n.py | 25 ++++++--- .../refs_translated_display_text.txt | 24 +++++++++ .../refs_translated_display_text.po | 51 +++++++++++++++++++ tests/test_intl/test_intl.py | 32 ++++++++++++ 4 files changed, 124 insertions(+), 8 deletions(-) create mode 100644 tests/roots/test-intl/refs_translated_display_text.txt create mode 100644 tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 3be280859c2..82488ed925b 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -282,14 +282,23 @@ def update_refnamed_references(self) -> None: is_refnamed_ref = NodeMatcher(nodes.reference, refname=Any) old_refs = list(is_refnamed_ref.findall(self.node)) new_refs = list(is_refnamed_ref.findall(self.patch)) - self.compare_references( - old_refs, - new_refs, - __( - 'inconsistent references in translated message.' - ' original: {0}, translated: {1}' - ), - ) + + # Only compare the count of references, not their refnames. + # Translators are allowed to change display text (which changes refname), + # and the fixup mechanism below will correct the refnames if needed. + 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] + logger.warning( + __( + 'inconsistent references in translated message.' + ' original: {0}, translated: {1}' + ).format(old_ref_rawsources, new_ref_rawsources), + location=self.node, + type='i18n', + subtype='inconsistent_references', + ) + old_ref_names = [r['refname'] for r in old_refs] new_ref_names = [r['refname'] for r in new_refs] orphans = [*({*old_ref_names} - {*new_ref_names})] diff --git a/tests/roots/test-intl/refs_translated_display_text.txt b/tests/roots/test-intl/refs_translated_display_text.txt new file mode 100644 index 00000000000..72067c997a8 --- /dev/null +++ b/tests/roots/test-intl/refs_translated_display_text.txt @@ -0,0 +1,24 @@ +:tocdepth: 2 + +i18n with translated display text for references +================================================= + +.. _vectorcall: https://peps.python.org/pep-0590/ +.. _Documentation bugs: https://github.com/sphinx-doc/sphinx/issues + +.. glossary:: + + locale encoding + The encoding used for the locale. + +.. rubric:: Test cases from issue #14162 + +1. Add translated display text for hyperlink (case 2): vectorcall_. + +2. Translated display text for hyperlink (case 3): `Improved suggestions `_. + +3. Use translated hyperlink tag (case 4): `Documentation bugs`_. + +4. Translated glossary term (case 5): :term:`locale encoding`. + +5. Multiple translated refs: vectorcall_ and `Documentation bugs`_. diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po new file mode 100644 index 00000000000..ac463516e28 --- /dev/null +++ b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po @@ -0,0 +1,51 @@ +# Test for translated display text in references. +# These should NOT trigger inconsistency warnings (issue #14162). +# +msgid "" +msgstr "" +"Project-Id-Version: sphinx 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-01-01 00:00+0000\n" +"PO-Revision-Date: 2024-01-01 00:00+0000\n" +"Last-Translator: Test\n" +"Language-Team: xx\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "i18n with translated display text for references" +msgstr "I18N WITH TRANSLATED DISPLAY TEXT FOR REFERENCES" + +msgid "The encoding used for the locale." +msgstr "THE ENCODING USED FOR THE LOCALE." + +msgid "Test cases from issue #14162" +msgstr "TEST CASES FROM ISSUE #14162" + +# Case 2: Add translated display text for hyperlink +# Original: vectorcall_ +# Translated: add display text but keep same target +msgid "Add translated display text for hyperlink (case 2): vectorcall_." +msgstr "ADD TRANSLATED DISPLAY TEXT FOR HYPERLINK (CASE 2): `VECTORCALL `_." + +# Case 3: Translated display text for hyperlink +# Original: `Improved suggestions `_ +# Translated: translate display text but keep same URL +msgid "Translated display text for hyperlink (case 3): `Improved suggestions `_." +msgstr "TRANSLATED DISPLAY TEXT FOR HYPERLINK (CASE 3): `SUGGERIMENTI MIGLIORATI `_." + +# Case 4: Use translated hyperlink tag +# Original: `Documentation bugs`_ +# Translated: translate tag name +msgid "Use translated hyperlink tag (case 4): `Documentation bugs`_." +msgstr "USE TRANSLATED HYPERLINK TAG (CASE 4): `TRANSLATED DOCUMENTATION BUGS `_." + +# Case 5: Translated glossary term +# Original: :term:`locale encoding` +# Translated: translate display text using explicit target syntax +msgid "Translated glossary term (case 5): :term:`locale encoding`." +msgstr "TRANSLATED GLOSSARY TERM (CASE 5): :term:`CODIFICAÇÃO DA LOCALIDADE `." + +# Multiple refs: should allow translating display text +msgid "Multiple translated refs: vectorcall_ and `Documentation bugs`_." +msgstr "MULTIPLE TRANSLATED REFS: `TRANSLATED DOCUMENTATION BUGS `_ AND `VECTORCALL `_." diff --git a/tests/test_intl/test_intl.py b/tests/test_intl/test_intl.py index c823a6a3b44..72bc2ff3047 100644 --- a/tests/test_intl/test_intl.py +++ b/tests/test_intl/test_intl.py @@ -413,6 +413,38 @@ def test_text_refs_reordered_no_warning(app: SphinxTestApp) -> None: ) +@sphinx_intl +@pytest.mark.sphinx('text', testroot='intl') +@pytest.mark.test_params(shared_result='test_intl_basic') +def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> None: + """Test that translated display text in references doesn't trigger warnings. + + This test covers cases 2-5 from issue #14162: + - Case 2: Add translated display text for hyperlink + - Case 3: Translated display text for hyperlink + - Case 4: Use translated hyperlink tag + - Case 5: Translated glossary term + """ + app.build() + result = (app.outdir / 'refs_translated_display_text.txt').read_text(encoding='utf8') + + # Verify the translations were applied + assert 'I18N WITH TRANSLATED DISPLAY TEXT FOR REFERENCES' in result + assert 'TEST CASES FROM ISSUE #14162' in result + assert 'ADD TRANSLATED DISPLAY TEXT FOR HYPERLINK (CASE 2)' in result + assert 'TRANSLATED DISPLAY TEXT FOR HYPERLINK (CASE 3)' in result + assert 'USE TRANSLATED HYPERLINK TAG (CASE 4)' in result + assert 'TRANSLATED GLOSSARY TERM (CASE 5)' in result + assert 'MULTIPLE TRANSLATED REFS' in result + + warnings = getwarning(app.warning) + # Should NOT have any inconsistent_references warnings for refs_translated_display_text.txt + unexpected_warning_expr = '.*/refs_translated_display_text.txt.*inconsistent.*references' + assert not re.search(unexpected_warning_expr, warnings), ( + f'Unexpected warning found: {warnings!r}' + ) + + @sphinx_intl @pytest.mark.sphinx('gettext', testroot='intl') @pytest.mark.test_params(shared_result='test_intl_gettext') From 75f6e467ea9b95dad2170ba62b8eabf9a06966df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 20 Dec 2025 21:25:15 +0000 Subject: [PATCH 3/7] Address code review feedback - Clarified comment about display text affecting rawsource comparison - Simplified case 4 test to better demonstrate the fixup mechanism Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com> --- sphinx/transforms/i18n.py | 4 ++-- .../xx/LC_MESSAGES/refs_translated_display_text.po | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 82488ed925b..a5d13cd2717 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -283,8 +283,8 @@ def update_refnamed_references(self) -> None: old_refs = list(is_refnamed_ref.findall(self.node)) new_refs = list(is_refnamed_ref.findall(self.patch)) - # Only compare the count of references, not their refnames. - # Translators are allowed to change display text (which changes refname), + # Only compare the count of references, not their content. + # Translators are allowed to change display text (which affects rawsource comparison), # and the fixup mechanism below will correct the refnames if needed. if not self.noqa and len(old_refs) != len(new_refs): old_ref_rawsources = [ref.rawsource for ref in old_refs] diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po index ac463516e28..9d517b7d69b 100644 --- a/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po +++ b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po @@ -36,9 +36,9 @@ msgstr "TRANSLATED DISPLAY TEXT FOR HYPERLINK (CASE 3): `SUGGERIMENTI MIGLIORATI # Case 4: Use translated hyperlink tag # Original: `Documentation bugs`_ -# Translated: translate tag name +# Translated: translate tag name - the fixup mechanism will correct the refname msgid "Use translated hyperlink tag (case 4): `Documentation bugs`_." -msgstr "USE TRANSLATED HYPERLINK TAG (CASE 4): `TRANSLATED DOCUMENTATION BUGS `_." +msgstr "USE TRANSLATED HYPERLINK TAG (CASE 4): `TRANSLATED DOCUMENTATION BUGS`_." # Case 5: Translated glossary term # Original: :term:`locale encoding` @@ -46,6 +46,6 @@ msgstr "USE TRANSLATED HYPERLINK TAG (CASE 4): `TRANSLATED DOCUMENTATION BUGS `." -# Multiple refs: should allow translating display text +# Multiple refs: should allow translating display text and rely on fixup msgid "Multiple translated refs: vectorcall_ and `Documentation bugs`_." -msgstr "MULTIPLE TRANSLATED REFS: `TRANSLATED DOCUMENTATION BUGS `_ AND `VECTORCALL `_." +msgstr "MULTIPLE TRANSLATED REFS: `TRANSLATED DOCUMENTATION BUGS`_ AND `VECTORCALL `_." From 374a031e9eff53fe9582e933f26ef66498701ae9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 23:03:11 +0000 Subject: [PATCH 4/7] Fix false positive warnings for term references with translated glossary terms - Modified update_pending_xrefs() to only check count, not reftarget content - This allows translators to translate glossary term names when glossary is also translated - Handles newlines from PO file wrapping without false warnings - Added comprehensive test cases covering all scenarios from the issue - All 43 intl tests passing Agent-Logs-Url: https://github.com/m-aciek/sphinx/sessions/5401f5a5-02a7-43cc-9525-a8039f9fa3f7 Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com> --- sphinx/transforms/i18n.py | 27 +++++++----- .../refs_translated_display_text.txt | 28 ++++++++++++ .../refs_translated_display_text.po | 43 +++++++++++++++++++ tests/test_intl/test_intl.py | 7 ++- 4 files changed, 93 insertions(+), 12 deletions(-) diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index a5d13cd2717..66aa20ad4a5 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -363,16 +363,23 @@ def update_pending_xrefs(self) -> None: # This code restricts to change ref-targets in the translation. old_xrefs = [*self.node.findall(addnodes.pending_xref)] new_xrefs = [*self.patch.findall(addnodes.pending_xref)] - self.compare_references( - old_xrefs, - new_xrefs, - __( - 'inconsistent term references in translated message.' - ' original: {0}, translated: {1}' - ), - # Compare by reftarget only, allowing translated display text. - key_func=lambda ref: ref.get('reftarget'), - ) + + # Only compare the count of cross-references, not their targets. + # For term references, translators may translate both display text and + # the term name itself (when the glossary is also translated). + # For other xrefs, the fixup mechanism below handles target corrections. + if not self.noqa and len(old_xrefs) != len(new_xrefs): + old_xref_rawsources = [ref.rawsource for ref in old_xrefs] + new_xref_rawsources = [ref.rawsource for ref in new_xrefs] + logger.warning( + __( + 'inconsistent term references in translated message.' + ' original: {0}, translated: {1}' + ).format(old_xref_rawsources, new_xref_rawsources), + location=self.node, + type='i18n', + subtype='inconsistent_references', + ) xref_reftarget_map: dict[tuple[str, str, str] | None, dict[str, Any]] = {} diff --git a/tests/roots/test-intl/refs_translated_display_text.txt b/tests/roots/test-intl/refs_translated_display_text.txt index 72067c997a8..9d2ca279ac1 100644 --- a/tests/roots/test-intl/refs_translated_display_text.txt +++ b/tests/roots/test-intl/refs_translated_display_text.txt @@ -10,6 +10,24 @@ i18n with translated display text for references locale encoding The encoding used for the locale. + + abstract base class + A base class that is abstract. + + text encoding + The encoding used for text. + + decorator + A function decorator. + + abstrakcyjna klasa bazowa + Translated: A base class that is abstract. + + kodowanie tekstu + Translated: The encoding used for text. + + dekorator + Translated: A function decorator. .. rubric:: Test cases from issue #14162 @@ -22,3 +40,13 @@ i18n with translated display text for references 4. Translated glossary term (case 5): :term:`locale encoding`. 5. Multiple translated refs: vectorcall_ and `Documentation bugs`_. + +.. rubric:: Additional term reference cases + +6. Term with explicit target and newline in source: :term:`virtual `. + +7. Term without explicit target: :term:`text encoding`. + +8. Simple term reference: :term:`decorator`. + +9. Multiple term refs: :term:`text encoding` and :term:`decorator`. diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po index 9d517b7d69b..ff0f87d0fbc 100644 --- a/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po +++ b/tests/roots/test-intl/xx/LC_MESSAGES/refs_translated_display_text.po @@ -19,6 +19,24 @@ msgstr "I18N WITH TRANSLATED DISPLAY TEXT FOR REFERENCES" msgid "The encoding used for the locale." msgstr "THE ENCODING USED FOR THE LOCALE." +msgid "A base class that is abstract." +msgstr "A BASE CLASS THAT IS ABSTRACT." + +msgid "The encoding used for text." +msgstr "THE ENCODING USED FOR TEXT." + +msgid "A function decorator." +msgstr "A FUNCTION DECORATOR." + +msgid "Translated: A base class that is abstract." +msgstr "TRANSLATED: A BASE CLASS THAT IS ABSTRACT." + +msgid "Translated: The encoding used for text." +msgstr "TRANSLATED: THE ENCODING USED FOR TEXT." + +msgid "Translated: A function decorator." +msgstr "TRANSLATED: A FUNCTION DECORATOR." + msgid "Test cases from issue #14162" msgstr "TEST CASES FROM ISSUE #14162" @@ -49,3 +67,28 @@ msgstr "TRANSLATED GLOSSARY TERM (CASE 5): :term:`CODIFICAÇÃO DA LOCALIDADE `_." + +msgid "Additional term reference cases" +msgstr "ADDITIONAL TERM REFERENCE CASES" + +# Term with explicit target - simulating newline in original (from PO wrapping) +# and translated glossary term name as target +msgid "" +"Term with explicit target and newline in source: :term:`virtual `." +msgstr "" +"TERM WITH EXPLICIT TARGET AND NEWLINE IN SOURCE: :term:`wirtualną " +"`." + +# Term without explicit target - translate the term name itself +# This simulates when the glossary is also translated +msgid "Term without explicit target: :term:`text encoding`." +msgstr "TERM WITHOUT EXPLICIT TARGET: :term:`kodowanie tekstu`." + +# Simple term reference - translate the term name +msgid "Simple term reference: :term:`decorator`." +msgstr "SIMPLE TERM REFERENCE: :term:`dekorator`." + +# Multiple term refs with translated names +msgid "Multiple term refs: :term:`text encoding` and :term:`decorator`." +msgstr "MULTIPLE TERM REFS: :term:`kodowanie tekstu` AND :term:`dekorator`." diff --git a/tests/test_intl/test_intl.py b/tests/test_intl/test_intl.py index 72bc2ff3047..c323634a14b 100644 --- a/tests/test_intl/test_intl.py +++ b/tests/test_intl/test_intl.py @@ -419,11 +419,13 @@ def test_text_refs_reordered_no_warning(app: SphinxTestApp) -> None: def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> None: """Test that translated display text in references doesn't trigger warnings. - This test covers cases 2-5 from issue #14162: + This test covers cases 2-5 from issue #14162 plus additional term reference cases: - Case 2: Add translated display text for hyperlink - Case 3: Translated display text for hyperlink - Case 4: Use translated hyperlink tag - - Case 5: Translated glossary term + - Case 5: Translated glossary term (with explicit target syntax) + - Additional: Term references with translated glossary term names + - Additional: Term references with newlines from PO file wrapping """ app.build() result = (app.outdir / 'refs_translated_display_text.txt').read_text(encoding='utf8') @@ -436,6 +438,7 @@ def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> Non assert 'USE TRANSLATED HYPERLINK TAG (CASE 4)' in result assert 'TRANSLATED GLOSSARY TERM (CASE 5)' in result assert 'MULTIPLE TRANSLATED REFS' in result + assert 'ADDITIONAL TERM REFERENCE CASES' in result warnings = getwarning(app.warning) # Should NOT have any inconsistent_references warnings for refs_translated_display_text.txt From 6940b86c6d22782f348eebfa56a932e58b547c50 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 23:06:20 +0000 Subject: [PATCH 5/7] Address code review feedback - remove unnecessary blank lines and fix docstring Agent-Logs-Url: https://github.com/m-aciek/sphinx/sessions/5401f5a5-02a7-43cc-9525-a8039f9fa3f7 Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com> --- sphinx/transforms/i18n.py | 4 ---- tests/test_intl/test_intl.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 66aa20ad4a5..71a21e16855 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -282,7 +282,6 @@ def update_refnamed_references(self) -> None: is_refnamed_ref = NodeMatcher(nodes.reference, refname=Any) old_refs = list(is_refnamed_ref.findall(self.node)) new_refs = list(is_refnamed_ref.findall(self.patch)) - # Only compare the count of references, not their content. # Translators are allowed to change display text (which affects rawsource comparison), # and the fixup mechanism below will correct the refnames if needed. @@ -298,7 +297,6 @@ def update_refnamed_references(self) -> None: type='i18n', subtype='inconsistent_references', ) - old_ref_names = [r['refname'] for r in old_refs] new_ref_names = [r['refname'] for r in new_refs] orphans = [*({*old_ref_names} - {*new_ref_names})] @@ -363,7 +361,6 @@ def update_pending_xrefs(self) -> None: # This code restricts to change ref-targets in the translation. old_xrefs = [*self.node.findall(addnodes.pending_xref)] new_xrefs = [*self.patch.findall(addnodes.pending_xref)] - # Only compare the count of cross-references, not their targets. # For term references, translators may translate both display text and # the term name itself (when the glossary is also translated). @@ -380,7 +377,6 @@ def update_pending_xrefs(self) -> None: type='i18n', subtype='inconsistent_references', ) - xref_reftarget_map: dict[tuple[str, str, str] | None, dict[str, Any]] = {} def get_ref_key(node: addnodes.pending_xref) -> tuple[str, str, str] | None: diff --git a/tests/test_intl/test_intl.py b/tests/test_intl/test_intl.py index c323634a14b..a9a90ecea81 100644 --- a/tests/test_intl/test_intl.py +++ b/tests/test_intl/test_intl.py @@ -425,7 +425,7 @@ def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> Non - Case 4: Use translated hyperlink tag - Case 5: Translated glossary term (with explicit target syntax) - Additional: Term references with translated glossary term names - - Additional: Term references with newlines from PO file wrapping + - Additional: Term references with newlines from PO file wrapping. """ app.build() result = (app.outdir / 'refs_translated_display_text.txt').read_text(encoding='utf8') From b874cb80a8635b907e6fe224ab9b9a04c6839f25 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 27 Mar 2026 11:44:11 +0100 Subject: [PATCH 6/7] Remove unnecessary blank lines in test for translated display text references --- tests/test_intl/test_intl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_intl/test_intl.py b/tests/test_intl/test_intl.py index a9a90ecea81..d00fc7aec46 100644 --- a/tests/test_intl/test_intl.py +++ b/tests/test_intl/test_intl.py @@ -418,7 +418,7 @@ def test_text_refs_reordered_no_warning(app: SphinxTestApp) -> None: @pytest.mark.test_params(shared_result='test_intl_basic') def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> None: """Test that translated display text in references doesn't trigger warnings. - + This test covers cases 2-5 from issue #14162 plus additional term reference cases: - Case 2: Add translated display text for hyperlink - Case 3: Translated display text for hyperlink @@ -429,7 +429,7 @@ def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> Non """ app.build() result = (app.outdir / 'refs_translated_display_text.txt').read_text(encoding='utf8') - + # Verify the translations were applied assert 'I18N WITH TRANSLATED DISPLAY TEXT FOR REFERENCES' in result assert 'TEST CASES FROM ISSUE #14162' in result From 7228531b021c63bab1705e88790405c2d5ec569a Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 27 Mar 2026 11:46:35 +0100 Subject: [PATCH 7/7] Reformat --- tests/test_intl/test_intl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_intl/test_intl.py b/tests/test_intl/test_intl.py index d00fc7aec46..b8d2cc761ca 100644 --- a/tests/test_intl/test_intl.py +++ b/tests/test_intl/test_intl.py @@ -428,7 +428,9 @@ def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> Non - Additional: Term references with newlines from PO file wrapping. """ app.build() - result = (app.outdir / 'refs_translated_display_text.txt').read_text(encoding='utf8') + result = (app.outdir / 'refs_translated_display_text.txt').read_text( + encoding='utf8' + ) # Verify the translations were applied assert 'I18N WITH TRANSLATED DISPLAY TEXT FOR REFERENCES' in result @@ -442,7 +444,9 @@ def test_text_refs_translated_display_text_no_warning(app: SphinxTestApp) -> Non warnings = getwarning(app.warning) # Should NOT have any inconsistent_references warnings for refs_translated_display_text.txt - unexpected_warning_expr = '.*/refs_translated_display_text.txt.*inconsistent.*references' + unexpected_warning_expr = ( + '.*/refs_translated_display_text.txt.*inconsistent.*references' + ) assert not re.search(unexpected_warning_expr, warnings), ( f'Unexpected warning found: {warnings!r}' )