Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep "translated" attribute on translated nodes #11502

Merged
merged 2 commits into from Jul 23, 2023

Commits on Jul 23, 2023

  1. Closes sphinx-doc#11157: Keep "translated" attribute on translated nodes

    `sphinx.transforms.Locale` iterates over all the nodes to replace its content
    with the translated version of the text if found. Since the process works in two
    phases, it adds an "internal" `translated: True` attribute to the docutils node
    when the translated text is found in phase 1, allowing phase 2 to skip this
    nodes and avoid re-processing them. Finally, this "internal" `translated`
    attribute is removed from all the nodes.
    
    This particular commit deletes the code that removes the `translated` attribute
    from the nodes so developers can use it to improve the experience on
    translations. This attribute can be useful to calculate the translated
    percentage of a particular document, to visually mark paragraphs as not
    translated and many other applications.
    humitos committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    9b50436 View commit details
    Browse the repository at this point in the history
  2. Remove shared_result from tests

    We cannot share results because the pickled doctree is not compatible between
    Sphinx versions.
    humitos committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    2c8909c View commit details
    Browse the repository at this point in the history