Cross-references issue when translating

Claude Paroz avatarClaude Paroz created an issue

When you translate a sentence containing references to a function (or attr, etc.), a warning is emitted and no link is produced:

WARNING: py:func reference target not found: sensitive_variables

Example source:

See this decorator: :func:`sensitive_variables`.

.. function:: sensitive_variables(*variables)

    Some description

Comments (13)

  1. Claude Paroz

    I think I was able to find a failing combination. Try to use that snippet in your test case:

    Welcome to issue1363
    =====================
    
    .. currentmodule:: sensitive
    
    See this decorator: :func:`sensitive_variables`.
    
    .. function:: sensitive_variables(*variables)
    
       Some description
    
    .. currentmodule:: reporting
    
    .. function:: report_errors(*variables)
    
       Some other description
    
  2. Takayuki Shimizukawa

    Fix i18n: missing python domain's cross-references with currentmodule directive or currentclass directive. refs #1363

    • node attributes 'py:module', 'py:class' is provided from environment (e.x. currentmodule directive is provided on previous line, not on node)
    • Because translation nodes are parsed in independently, 'provided attributes by environment' are not exist.
    • For a pending_xref nodes, all attributes of a translated xref node should be same as original xref node in current test cases.
    • For the above reasons, I overwrite all attributes from origonal node to new translated xref node.

    → <<cset 2ab2c2adea63>>

  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.