Extract translatable strings alongside their doctree nodes.

This commit is contained in:
Robert Lehmann 2010-06-16 20:27:27 +02:00
parent 0109af80b5
commit cd07472676
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class MessageCatalogBuilder(Builder):
otherwise its *name* -- is considered its section.
"""
catalog = self.catalogs[docname.split('/')[0]]
for msg in extract_messages(doctree):
for _, msg in extract_messages(doctree):
# XXX msgctxt for duplicate messages
if msg not in catalog:
catalog.append(msg)

View File

@ -30,7 +30,7 @@ def extract_messages(doctree):
msg = node.astext().replace('\n', ' ').strip()
# XXX nodes rendering empty are likely a bug in sphinx.addnodes
if msg:
yield msg
yield node, msg
def nested_parse_with_titles(state, content, node):