summaryrefslogtreecommitdiff
path: root/sphinx/util
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2013-10-04 05:07:09 +0900
committershimizukawa <shimizukawa@gmail.com>2013-10-04 05:07:09 +0900
commitc3e34e0e59f9f1e16a7eed958685c854c666b96e (patch)
tree0c0e2d2a71ef4854b60deb4113cbb78f41243af0 /sphinx/util
parentc0ec30bb423782d83b55e7cd1590fb20d396901a (diff)
downloadsphinx-c3e34e0e59f9f1e16a7eed958685c854c666b96e.tar.gz
Now gettext translates label target name. Fix i18n: crash when using a indirect target and translating a target section name. Closes #1265
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/nodes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py
index a8395f60..2690cf3a 100644
--- a/sphinx/util/nodes.py
+++ b/sphinx/util/nodes.py
@@ -77,6 +77,13 @@ def extract_messages(doctree):
yield node, msg
+def traverse_translatable_target(doctree):
+ """Extract translatable target from a document tree."""
+ for node in doctree.traverse(nodes.target):
+ if 'names' in node and node['names']:
+ yield node, node['names'][0]
+
+
def traverse_translatable_index(doctree):
"""Traverse translatable index node from a document tree."""
def is_block_index(node):