Crash when translating link to another link

Claude Paroz avatarClaude Paroz created an issue

I'm getting a crash (see attached traceback) with 1.2b2 when translating documentation containing something like the following:

It's sometimes useful to pre-populate your database with hard-coded data when
you're first setting up an app. There's a couple of ways you can have Django
automatically create this data: you can provide `initial data via fixtures`_, or
you can provide `initial data as SQL`_.

In general, using a fixture is a cleaner method since it's database-agnostic,
but initial SQL is also quite a bit more flexible.

.. _initial data as sql: `providing initial sql data`_
.. _initial data via fixtures: `providing initial data with fixtures`_

Then later:

.. _initial-data-via-fixtures:

Providing initial data with fixtures
====================================
...

.. _initial-sql:

Providing initial SQL data
==========================
...

I'm suspecting there is an issue when links point to other links. The same content seems to compile fine with 1.2b1.

Comments (18)

  1. Takayuki Shimizukawa
    • changed status to open

    I got the same error.

    • use internal link to label target (_label: target).
    • define label taget to internal section title.
    • using i18n translation feature.
    • translate section title.
  2. Claude Paroz

    Many thanks, I've verified that the crash is indeed fixed. However, I'm afraid we are facing a similar bug as #1193. Could you complete the test with two links in the same paragraph and checking that both links are indeed different in the resulting translation?

  3. Claude Paroz

    Takayuki, the example is exactly in the original ticket description (two links in the same paragraph, both links are then identical (but should not) in translated output).

  4. Claude Paroz

    Takayuki, many thanks for your help. However, I'm still wondering if translating the label names is a good idea. Is it right that your are counting on the translator doing the same translation in the paragraph referencing the label and the label name? If yes, isn't this a bit fragile? I'm not saying I have a better proposal. In any case, we might move this discussion in another ticket probably.

  5. 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.