mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Extract translatable strings alongside their doctree nodes.
This commit is contained in:
parent
0109af80b5
commit
cd07472676
@ -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)
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user