summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François B <2589111+jfbu@users.noreply.github.com>2023-03-31 23:58:48 +0200
committerJean-François B <2589111+jfbu@users.noreply.github.com>2023-04-01 00:02:18 +0200
commit6809ca7d04da47f8780647296961934cdc07e14a (patch)
treedc4f31332f5da90fe1462af3a48b601276f20b08
parent40ec19035372070ac4c273aeeb2d3288b3f45196 (diff)
downloadsphinx-git-6809ca7d04da47f8780647296961934cdc07e14a.tar.gz
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.
-rw-r--r--sphinx/builders/latex/transforms.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/builders/latex/transforms.py b/sphinx/builders/latex/transforms.py
index df678d91f..bd295de12 100644
--- a/sphinx/builders/latex/transforms.py
+++ b/sphinx/builders/latex/transforms.py
@@ -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):