summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcocoatomo <cocoatomo77@gmail.com>2018-02-07 01:06:31 +0900
committercocoatomo <cocoatomo77@gmail.com>2018-02-07 01:52:22 +0900
commit8969ae40de76f27bec1e7af558a72a30558138ed (patch)
tree76833f29567115b25b403a2f9ab400707a25358e
parent7e5974f26c44c09c82373d42e1a15d1ee8981a3e (diff)
downloadsphinx-git-8969ae40de76f27bec1e7af558a72a30558138ed.tar.gz
Make the log message more translation-friendly
-rw-r--r--sphinx/application.py6
-rw-r--r--tests/test_application.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index 35110c0cd..227c1fb54 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -687,8 +687,10 @@ class Sphinx(object):
"""
if typ == 'read':
attrname = 'parallel_read_safe'
+ gerund_typ = __("reading")
elif typ == 'write':
attrname = 'parallel_write_safe'
+ gerund_typ = __("writing")
else:
raise ValueError('parallel type %s is not supported' % typ)
@@ -696,9 +698,9 @@ class Sphinx(object):
allowed = getattr(ext, attrname, None)
if allowed is None:
logger.warning(__("the %s extension does not declare if it is safe "
- "for parallel %sing, assuming it isn't - please "
+ "for parallel %s, assuming it isn't - please "
"ask the extension author to check and make it "
- "explicit"), ext.name, typ)
+ "explicit"), ext.name, gerund_typ)
logger.warning('doing serial %s', typ)
return False
elif not allowed:
diff --git a/tests/test_application.py b/tests/test_application.py
index 12b6bbe60..c4c2e579b 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -106,7 +106,8 @@ def test_add_is_parallel_allowed(app, status, warning):
app.setup_extension('write_parallel')
assert app.is_parallel_allowed('read') is False
assert app.is_parallel_allowed('write') is True
- assert 'the write_parallel extension does not declare' in warning.getvalue()
+ assert ("the write_parallel extension does not declare if it is safe "
+ "for parallel reading, assuming it isn't - please ") in warning.getvalue()
app.extensions.pop('write_parallel')
warning.truncate(0) # reset warnings
@@ -119,6 +120,7 @@ def test_add_is_parallel_allowed(app, status, warning):
app.setup_extension('write_serial')
assert app.is_parallel_allowed('read') is False
assert app.is_parallel_allowed('write') is False
- assert 'the write_serial extension does not declare' in warning.getvalue()
+ assert ("the write_serial extension does not declare if it is safe "
+ "for parallel reading, assuming it isn't - please ") in warning.getvalue()
app.extensions.pop('write_serial')
warning.truncate(0) # reset warnings