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

kenhys avatarkenhys 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
done
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 (http://mroonga.org) 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 (6)

  1. kenhys

    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

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.