mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #10022 from tk0miya/fix_non_translated_messages
Fix some messages are still not translated
This commit is contained in:
commit
8600f438e6
@ -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]
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user