refs #3588: No compact (p tag) html output in the i18n document build even when :confval:html_compact_lists is True.

This commit is contained in:
shimizukawa 2017-05-01 17:17:14 +09:00
parent b9b982d5f0
commit fdebd2b1b2
2 changed files with 13 additions and 4 deletions

View File

@ -13,6 +13,9 @@ Features added
Bugs fixed
----------
* #3588: No compact (p tag) html output in the i18n document build even when
:confval:`html_compact_lists` is True.
Testing
--------

View File

@ -215,12 +215,12 @@ class Locale(SphinxTransform):
for child in patch.children:
child.parent = node
node.children = patch.children
node['translated'] = True
node['translated'] = True # to avoid double translation
# phase2: translation
for node, msg in extract_messages(self.document):
if node.get('translated', False):
continue
if node.get('translated', False): # to avoid double translation
continue # skip if the node is already translated by phase1
msgstr = catalog.gettext(msg)
# XXX add marker to untranslated parts
@ -395,7 +395,7 @@ class Locale(SphinxTransform):
if isinstance(node, IMAGE_TYPE_NODES):
node.update_all_atts(patch)
node['translated'] = True
node['translated'] = True # to avoid double translation
if 'index' in self.config.gettext_additional_targets:
# Extract and translate messages for index entries.
@ -415,6 +415,12 @@ class Locale(SphinxTransform):
node['raw_entries'] = entries
node['entries'] = new_entries
# remove translated attribute that is used for avoiding double translation.
def has_translatable(node):
return isinstance(node, nodes.Element) and 'translated' in node
for node in self.document.traverse(has_translatable):
node.delattr('translated')
class RemoveTranslatableInline(SphinxTransform):
"""