mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #1734: Could not translate the caption of toctree directive
This commit is contained in:
@@ -118,6 +118,11 @@ def assert_count(expected_expr, result, count):
|
||||
def test_text_builder(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
# --- toctree
|
||||
|
||||
result = (app.outdir / 'contents.txt').text(encoding='utf-8')
|
||||
yield assert_startswith, result, u"CONTENTS\n********\n\nTABLE OF CONTENTS\n"
|
||||
|
||||
# --- warnings in translation
|
||||
|
||||
warnings = getwarning(warning)
|
||||
@@ -318,6 +323,12 @@ def test_text_builder(app, status, warning):
|
||||
def test_gettext_builder(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
# --- toctree
|
||||
expect = read_po(app.srcdir / 'contents.po')
|
||||
actual = read_po(app.outdir / 'contents.pot')
|
||||
for expect_msg in [m for m in expect if m.id]:
|
||||
yield assert_in, expect_msg.id, [m.id for m in actual if m.id]
|
||||
|
||||
# --- definition terms: regression test for #2198, #2205
|
||||
expect = read_po(app.srcdir / 'definition_terms.po')
|
||||
actual = read_po(app.outdir / 'definition_terms.pot')
|
||||
|
||||
Reference in New Issue
Block a user