From 6faef281505e1e4ba89d6af2058613d1d387dd46 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 25 Feb 2018 22:16:09 +0900 Subject: Make console and warning messages translatable --- sphinx/directives/code.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sphinx/directives/code.py') diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 51abc252b..17e77327d 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -126,7 +126,7 @@ class CodeBlock(Directive): nlines = len(self.content) hl_lines = parselinenos(linespec, nlines) if any(i >= nlines for i in hl_lines): - logger.warning('line number spec is out of range(1-%d): %r' % + logger.warning(__('line number spec is out of range(1-%d): %r') % (nlines, self.options['emphasize-lines']), location=location) @@ -268,7 +268,7 @@ class LiteralIncludeReader(object): if linespec: linelist = parselinenos(linespec, len(lines)) if any(i >= len(lines) for i in linelist): - logger.warning('line number spec is out of range(1-%d): %r' % + logger.warning(__('line number spec is out of range(1-%d): %r') % (len(lines), linespec), location=location) if 'lineno-match' in self.options: @@ -440,7 +440,7 @@ class LiteralInclude(Directive): if 'emphasize-lines' in self.options: hl_lines = parselinenos(self.options['emphasize-lines'], lines) if any(i >= lines for i in hl_lines): - logger.warning('line number spec is out of range(1-%d): %r' % + logger.warning(__('line number spec is out of range(1-%d): %r') % (lines, self.options['emphasize-lines']), location=location) extra_args['hl_lines'] = [x + 1 for x in hl_lines if x < lines] -- cgit v1.2.1