Issue #1300 resolved

WARNING: undefined label :ref: tag can't generate HTML cross reference properlly for i18n documentation

created an issue

The issue

I used :ref: tag but it seems that HTML cross references are not properlly generated.

  • news.rst ( define .. _release-1-20 label)
  • install.rst ( there is a reference to :ref:release-1-20

but it seems that sphinx can't find label in Japanese documentation. It works for English documentation.

Here is the output results at that time.

pickling environment... done
checking consistency... /home/kenhys/work/sphinx/sphinx-missing-xref/doc/source/news.rst:: WARNING: document isn't included in any toctree
preparing documents... done
writing output... [ 33%] index
writing output... [ 66%] install
writing output... [100%] news

/home/kenhys/work/sphinx/sphinx-missing-xref/doc/source/install.rst:23: WARNING: undefined label: release-1-20 (if the link has no caption the label must precede a section header)
/home/kenhys/work/sphinx/sphinx-missing-xref/doc/source/install.rst:25: WARNING: undefined label: release-2-00 (if the link has no caption the label must precede a section header)

Actual Result

doc/locale/ja/html/install.html shows:

<em class="xref std std-ref">release-1-20</em> を参照してください。

Expected Result

doc/locale/ja/html/install.html shows:

<a class="reference internal" href="news.html#release-1-02"><em>1.20リリース - 2012/01/29</em></a>

How to reproduce

I've attached archives which reproduced this situation.

This issue is found on Mroonga ( documentation. I try to minimize from original source, the directory structure may be strange for normal sphinx user.

Here is the tree of arvhives:

  • doc/source (rst text)
  • doc/locale/ja/html (Japanese documentation)
  • doc/locale/en/html (English documentation)

Comments (9)

  1. kenhys reporter

    Here is the summary of sphinx:

    % hg summary
    parent: 4359:e55c174b5dc5 
     Merged in minrk/sphinx/minrk/sort-inheritance-diagram (pull request #183)
    branch: default
    commit: (clean)
    update: (current)
  2. Georg Brandl repo owner

    Found a solution for 1.2.1 which should not be too problematic:

    the issue is

                        # re-entry with new named section node.
                        self.document.note_implicit_target(section_node, section_node)

    -- if the target name is duplicate this will insert a system_message node which gets the release-1-20 name somehow. I removed the second argument which suppresses the system_message.

    Takayuki Shimizukawa If you think the message should stay maybe you can find a different way to emit it.

  3. Log in to comment