Rendering the directives in a toctree with internationalization and when not providing a caption option returns None on the translated output.
index.rst with the following content:.. toctree::
:maxdepth: 2
:numbered:
1_page
1_page.rst with the following content:Page1
=====
Subtitle
--------
Lorem ipsum
make html, the resulting html exists:<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="1_page.html">1. Page1</a><ul>
<li class="toctree-l2"><a class="reference internal" href="1_page.html#subtitle">1.1. Subtitle</a></li>
</ul>
</li>
</ul>
</div>
This is the expected behavior, and accurate so far.
Running a localization command to render .po files with string translations:
make -e SPHINXOPTS="-D language='es'" html
Produces the following HTML:
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">None</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="1_page.html">1. Page1</a><ul>
<li class="toctree-l2"><a class="reference internal" href="1_page.html#subtitle">1.1. Subtitle</a></li>
</ul>
</li>
</ul>
</div>
Note the addition of caption class with some text, this is not expected.
If the toctree contains :caption: Contents: or such, then the None is replaced with Contents: or the localized string.
Thanks for your reporting. I confirmed by official doc :-( http://www.sphinx-doc.org/ja/stable/contents.html
I'll take a look.
The problem will happen only with Py2.
Fixed.
Wonderful, thanks for your speed on this!