mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
format translatable strings in one go. This enables translation tools like msgfmt to verify that an incorrect translation cannot crash sphinx-build. This will fix current crashes for Hungarian and Greek (Spanish was fixed in #8941)
This commit is contained in:
parent
99d97c65d5
commit
cf85d3afd1
@ -168,14 +168,13 @@ class ReferencesResolver(SphinxPostTransform):
|
|||||||
if self.app.emit_firstresult('warn-missing-reference', domain, node):
|
if self.app.emit_firstresult('warn-missing-reference', domain, node):
|
||||||
return
|
return
|
||||||
elif domain and typ in domain.dangling_warnings:
|
elif domain and typ in domain.dangling_warnings:
|
||||||
msg = domain.dangling_warnings[typ]
|
msg = domain.dangling_warnings[typ] % {'target': target}
|
||||||
elif node.get('refdomain', 'std') not in ('', 'std'):
|
elif node.get('refdomain', 'std') not in ('', 'std'):
|
||||||
msg = (__('%s:%s reference target not found: %%(target)s') %
|
msg = (__('%s:%s reference target not found: %s') %
|
||||||
(node['refdomain'], typ))
|
(node['refdomain'], typ, target))
|
||||||
else:
|
else:
|
||||||
msg = __('%r reference target not found: %%(target)s') % typ
|
msg = __('%r reference target not found: %s') % (typ, target)
|
||||||
logger.warning(msg % {'target': target},
|
logger.warning(msg, location=node, type='ref', subtype=typ)
|
||||||
location=node, type='ref', subtype=typ)
|
|
||||||
|
|
||||||
|
|
||||||
class OnlyNodeTransform(SphinxPostTransform):
|
class OnlyNodeTransform(SphinxPostTransform):
|
||||||
|
Loading…
Reference in New Issue
Block a user