The `gettext_enables config value has been renamed to gettext_additional_targets`.

This commit is contained in:
shimizukawa 2015-02-21 23:48:18 +09:00
parent 62e0490b81
commit d5dca56ff8
7 changed files with 11 additions and 9 deletions

View File

@ -5,6 +5,8 @@ Incompatible changes
--------------------
* Dependency requirement updates: docutils 0.11, Pygments 2.0
* The ``gettext_enables`` config value has been renamed to
`gettext_additional_targets`.
Features added
--------------
@ -101,7 +103,7 @@ Incompatible changes
Additionally, if the ``python-levenshtein`` 3rd-party package is installed,
it will improve the calculation time.
* gettext builder: disable extracting/apply 'index' node by default. Please set
'index' to :confval:`gettext_enables` to enable extracting index entries.
'index' to ``gettext_enables`` to enable extracting index entries.
* PR#307: Add frame to code-block in LaTeX. Thanks to Takeshi Komiya.
Features added
@ -172,7 +174,7 @@ Features added
target. Thanks to Takeshi Komiya.
* PR#298: Add new API: :meth:`~sphinx.application.Sphinx.add_latex_package`.
Thanks to Takeshi Komiya.
* #1344: add :confval:`gettext_enables` to enable extracting 'index' to gettext
* #1344: add ``gettext_enables`` to enable extracting 'index' to gettext
catalog output / applying translation catalog to generated documentation.
* PR#301, #1583: Allow the line numbering of the directive `literalinclude` to
match that of the included file, using a new ``lineno-match`` option. Thanks

View File

@ -488,10 +488,10 @@ documentation on :ref:`intl` for details.
.. versionadded:: 1.3
.. confval:: gettext_enables
.. confval:: gettext_additional_targets
To specify names to enable gettext extracting and translation applying for
i18n. You can specify below names:
i18n additionally. You can specify below names:
:index: index terms

View File

@ -113,7 +113,7 @@ class I18nBuilder(Builder):
for node, msg in extract_messages(doctree):
catalog.add(msg, node)
if 'index' in self.env.config.gettext_enables:
if 'index' in self.env.config.gettext_additional_targets:
# Extract translatable messages from index entries.
for node, entries in traverse_translatable_index(doctree):
for typ, msg, tid, main in entries:

View File

@ -215,7 +215,7 @@ class Config(object):
gettext_location = (True, 'gettext'),
gettext_uuid = (False, 'gettext'),
gettext_auto_build = (True, 'env'),
gettext_enables = ([], 'env'),
gettext_additional_targets = ([], 'env'),
# XML options
xml_pretty = (True, 'env'),

View File

@ -468,7 +468,7 @@ class Locale(Transform):
node.children = patch.children
node['translated'] = True
if 'index' in env.config.gettext_enables:
if 'index' in env.config.gettext_additional_targets:
# Extract and translate messages for index entries.
for node, entries in traverse_translatable_index(self.document):
new_entries = []

View File

@ -6,4 +6,4 @@ keep_warnings = True
templates_path = ['_templates']
html_additional_pages = {'index': 'index.html'}
release = version = '2013.120'
gettext_enables = ['index']
gettext_additional_targets = ['index']

View File

@ -124,7 +124,7 @@ def test_gettext_index_entries(app, status, warning):
@with_app('gettext', testroot='intl',
confoverrides={'gettext_compact': False, 'gettext_enables': []})
confoverrides={'gettext_compact': False, 'gettext_additional_targets': []})
def test_gettext_disable_index_entries(app, status, warning):
# regression test for #976
app.builder.build(['index_entries'])