Fix some messages are still not translated

This commit is contained in:
Takeshi KOMIYA 2021-12-27 02:28:45 +09:00
parent 8ddf3f09c6
commit 59cb7466b5
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ from docutils import nodes, utils
from docutils.nodes import Element, Node, TextElement, system_message
from sphinx import addnodes
from sphinx.locale import _
from sphinx.locale import _, __
from sphinx.util import ws_re
from sphinx.util.docutils import ReferenceRole, SphinxRole
from sphinx.util.typing import RoleFunction
@ -190,7 +190,7 @@ class PEP(ReferenceRole):
title = "PEP " + self.title
reference += nodes.strong(title, title)
except ValueError:
msg = self.inliner.reporter.error('invalid PEP number %s' % self.target,
msg = self.inliner.reporter.error(__('invalid PEP number %s') % self.target,
line=self.lineno)
prb = self.inliner.problematic(self.rawtext, self.rawtext, msg)
return [prb], [msg]
@ -224,7 +224,7 @@ class RFC(ReferenceRole):
title = "RFC " + self.title
reference += nodes.strong(title, title)
except ValueError:
msg = self.inliner.reporter.error('invalid RFC number %s' % self.target,
msg = self.inliner.reporter.error(__('invalid RFC number %s') % self.target,
line=self.lineno)
prb = self.inliner.problematic(self.rawtext, self.rawtext, msg)
return [prb], [msg]

View File

@ -78,8 +78,8 @@ class Field:
role = env.get_domain(domain).role(rolename)
if role is None or inliner is None:
if role is None and inliner is not None:
msg = "Problem in %s domain: field is supposed "
msg += "to use role '%s', but that role is not in the domain."
msg = __("Problem in %s domain: field is supposed "
"to use role '%s', but that role is not in the domain.")
logger.warning(__(msg), domain, rolename, location=location)
refnode = addnodes.pending_xref('', refdomain=domain, refexplicit=False,
reftype=rolename, reftarget=target)