mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merged in KangOl/sphinx (pull request #79)
This commit is contained in:
commit
f514af7bda
@ -213,19 +213,23 @@ class Locale(Transform):
|
||||
parser = RSTParser()
|
||||
|
||||
for node, msg in extract_messages(self.document):
|
||||
patch = new_document(source, settings)
|
||||
msgstr = catalog.gettext(msg)
|
||||
# XXX add marker to untranslated parts
|
||||
if not msgstr or msgstr == msg: # as-of-yet untranslated
|
||||
continue
|
||||
|
||||
patch = new_document(source, settings)
|
||||
parser.parse(msgstr, patch)
|
||||
patch = patch[0]
|
||||
# XXX doctest and other block markup
|
||||
if not isinstance(patch, nodes.paragraph):
|
||||
continue # skip for now
|
||||
for child in patch.children: # update leaves
|
||||
child.parent = node
|
||||
node.children = patch.children
|
||||
|
||||
# copy text children
|
||||
for i, child in enumerate(patch.children):
|
||||
if isinstance(child, nodes.Text):
|
||||
child.parent = node
|
||||
node.children[i] = child
|
||||
|
||||
|
||||
class SphinxStandaloneReader(standalone.Reader):
|
||||
|
Loading…
Reference in New Issue
Block a user