mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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:
parent
b9b982d5f0
commit
fdebd2b1b2
3
CHANGES
3
CHANGES
@ -13,6 +13,9 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #3588: No compact (p tag) html output in the i18n document build even when
|
||||||
|
:confval:`html_compact_lists` is True.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -215,12 +215,12 @@ class Locale(SphinxTransform):
|
|||||||
for child in patch.children:
|
for child in patch.children:
|
||||||
child.parent = node
|
child.parent = node
|
||||||
node.children = patch.children
|
node.children = patch.children
|
||||||
node['translated'] = True
|
node['translated'] = True # to avoid double translation
|
||||||
|
|
||||||
# phase2: translation
|
# phase2: translation
|
||||||
for node, msg in extract_messages(self.document):
|
for node, msg in extract_messages(self.document):
|
||||||
if node.get('translated', False):
|
if node.get('translated', False): # to avoid double translation
|
||||||
continue
|
continue # skip if the node is already translated by phase1
|
||||||
|
|
||||||
msgstr = catalog.gettext(msg)
|
msgstr = catalog.gettext(msg)
|
||||||
# XXX add marker to untranslated parts
|
# XXX add marker to untranslated parts
|
||||||
@ -395,7 +395,7 @@ class Locale(SphinxTransform):
|
|||||||
if isinstance(node, IMAGE_TYPE_NODES):
|
if isinstance(node, IMAGE_TYPE_NODES):
|
||||||
node.update_all_atts(patch)
|
node.update_all_atts(patch)
|
||||||
|
|
||||||
node['translated'] = True
|
node['translated'] = True # to avoid double translation
|
||||||
|
|
||||||
if 'index' in self.config.gettext_additional_targets:
|
if 'index' in self.config.gettext_additional_targets:
|
||||||
# Extract and translate messages for index entries.
|
# Extract and translate messages for index entries.
|
||||||
@ -415,6 +415,12 @@ class Locale(SphinxTransform):
|
|||||||
node['raw_entries'] = entries
|
node['raw_entries'] = entries
|
||||||
node['entries'] = new_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):
|
class RemoveTranslatableInline(SphinxTransform):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user