mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix error message wording in builders/latex/transforms.py
And make it and the two other ones there translatable strings. Using .format for the f-string.
This commit is contained in:
@@ -18,6 +18,7 @@ from sphinx.builders.latex.nodes import (
|
||||
thebibliography,
|
||||
)
|
||||
from sphinx.domains.citation import CitationDomain
|
||||
from sphinx.locale import __
|
||||
from sphinx.transforms import SphinxTransform
|
||||
from sphinx.transforms.post_transforms import SphinxPostTransform
|
||||
from sphinx.util.nodes import NodeMatcher
|
||||
@@ -110,8 +111,9 @@ class ShowUrlsTransform(SphinxPostTransform):
|
||||
try:
|
||||
source = node['source'] # type: ignore[index]
|
||||
except TypeError:
|
||||
raise ValueError('Failed to get a docname!') from None
|
||||
raise ValueError(f'Failed to get a docname for source {source!r}!')
|
||||
raise ValueError(__('Failed to get a docname!')) from None
|
||||
raise ValueError(__('Failed to get a docname '
|
||||
'for source {source!r}!').format(source=source))
|
||||
|
||||
def create_footnote(
|
||||
self, uri: str, docname: str,
|
||||
@@ -471,7 +473,7 @@ class LaTeXFootnoteVisitor(nodes.NodeVisitor):
|
||||
if docname == footnote['docname'] and footnote['ids'][0] == node['refid']:
|
||||
return footnote
|
||||
|
||||
raise ValueError('No footnote not found for given reference node %r' % node)
|
||||
raise ValueError(__('No footnote was found for given reference node %r') % node)
|
||||
|
||||
|
||||
class BibliographyTransform(SphinxPostTransform):
|
||||
|
||||
Reference in New Issue
Block a user