Skip to content

Commit

Permalink
Fix #6620: i18n: classifiers of definition list are not translated wi…
Browse files Browse the repository at this point in the history
…th docutils-0.15
  • Loading branch information
tk0miya committed Aug 1, 2019
1 parent 57777da commit c45f962
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Bugs fixed
* #6549: sphinx-build: Escaped characters in error messages
* #6545: doctest comments not getting trimmed since Sphinx 1.8.0
* #6561: glossary: Wrong hyperlinks are generated for non alphanumeric terms
* #6620: i18n: classifiers of definition list are not translated with
docutils-0.15

Testing
--------
Expand Down
3 changes: 3 additions & 0 deletions sphinx/util/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def apply_source_workaround(node: Element) -> None:
node.source = definition_list_item.source
node.line = definition_list_item.line - 1
node.rawsource = node.astext() # set 'classifier1' (or 'classifier2')
elif isinstance(node, nodes.classifier) and not node.source:
# docutils-0.15 fills in rawsource attribute, but not in source.
node.source = node.parent.source
if isinstance(node, nodes.image) and node.source is None:
logger.debug('[i18n] PATCH: %r to have source, line: %s',
get_full_module_name(node), repr_domxml(node))
Expand Down

0 comments on commit c45f962

Please sign in to comment.