diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-02-25 22:16:09 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-03 23:18:38 +0900 |
commit | 6faef281505e1e4ba89d6af2058613d1d387dd46 (patch) | |
tree | 4734fe29d42042ee9bb0fab69087c8ffeb224e73 /sphinx/highlighting.py | |
parent | 1f5b40c291fc9cc16c323ef6aa4cd417b929bf0f (diff) | |
download | sphinx-git-6faef281505e1e4ba89d6af2058613d1d387dd46.tar.gz |
Make console and warning messages translatable
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index a14efd510..372ab7c43 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -23,6 +23,7 @@ from pygments.util import ClassNotFound from six import text_type from sphinx.ext import doctest +from sphinx.locale import __ from sphinx.pygments_styles import SphinxStyle, NoneStyle from sphinx.util import logging from sphinx.util.pycompat import htmlescape @@ -132,7 +133,7 @@ class PygmentsBridge(object): try: lexer = lexers[lang] = get_lexer_by_name(lang, **(opts or {})) except ClassNotFound: - logger.warning('Pygments lexer name %r is not known', lang, + logger.warning(__('Pygments lexer name %r is not known'), lang, location=location) lexer = lexers['none'] else: @@ -153,8 +154,8 @@ class PygmentsBridge(object): if lang == 'default': pass # automatic highlighting failed. else: - logger.warning('Could not lex literal_block as "%s". ' - 'Highlighting skipped.', lang, + logger.warning(__('Could not lex literal_block as "%s". ' + 'Highlighting skipped.'), lang, type='misc', subtype='highlighting_failure', location=location) hlsource = highlight(source, lexers['none'], formatter) |