mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
The `gettext_enables config value has been renamed to gettext_additional_targets`.
This commit is contained in:
6
CHANGES
6
CHANGES
@@ -5,6 +5,8 @@ Incompatible changes
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
* Dependency requirement updates: docutils 0.11, Pygments 2.0
|
* Dependency requirement updates: docutils 0.11, Pygments 2.0
|
||||||
|
* The ``gettext_enables`` config value has been renamed to
|
||||||
|
`gettext_additional_targets`.
|
||||||
|
|
||||||
Features added
|
Features added
|
||||||
--------------
|
--------------
|
||||||
@@ -101,7 +103,7 @@ Incompatible changes
|
|||||||
Additionally, if the ``python-levenshtein`` 3rd-party package is installed,
|
Additionally, if the ``python-levenshtein`` 3rd-party package is installed,
|
||||||
it will improve the calculation time.
|
it will improve the calculation time.
|
||||||
* gettext builder: disable extracting/apply 'index' node by default. Please set
|
* 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.
|
* PR#307: Add frame to code-block in LaTeX. Thanks to Takeshi Komiya.
|
||||||
|
|
||||||
Features added
|
Features added
|
||||||
@@ -172,7 +174,7 @@ Features added
|
|||||||
target. Thanks to Takeshi Komiya.
|
target. Thanks to Takeshi Komiya.
|
||||||
* PR#298: Add new API: :meth:`~sphinx.application.Sphinx.add_latex_package`.
|
* PR#298: Add new API: :meth:`~sphinx.application.Sphinx.add_latex_package`.
|
||||||
Thanks to Takeshi Komiya.
|
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.
|
catalog output / applying translation catalog to generated documentation.
|
||||||
* PR#301, #1583: Allow the line numbering of the directive `literalinclude` to
|
* 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
|
match that of the included file, using a new ``lineno-match`` option. Thanks
|
||||||
|
|||||||
@@ -488,10 +488,10 @@ documentation on :ref:`intl` for details.
|
|||||||
|
|
||||||
.. versionadded:: 1.3
|
.. versionadded:: 1.3
|
||||||
|
|
||||||
.. confval:: gettext_enables
|
.. confval:: gettext_additional_targets
|
||||||
|
|
||||||
To specify names to enable gettext extracting and translation applying for
|
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
|
:index: index terms
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class I18nBuilder(Builder):
|
|||||||
for node, msg in extract_messages(doctree):
|
for node, msg in extract_messages(doctree):
|
||||||
catalog.add(msg, node)
|
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.
|
# Extract translatable messages from index entries.
|
||||||
for node, entries in traverse_translatable_index(doctree):
|
for node, entries in traverse_translatable_index(doctree):
|
||||||
for typ, msg, tid, main in entries:
|
for typ, msg, tid, main in entries:
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ class Config(object):
|
|||||||
gettext_location = (True, 'gettext'),
|
gettext_location = (True, 'gettext'),
|
||||||
gettext_uuid = (False, 'gettext'),
|
gettext_uuid = (False, 'gettext'),
|
||||||
gettext_auto_build = (True, 'env'),
|
gettext_auto_build = (True, 'env'),
|
||||||
gettext_enables = ([], 'env'),
|
gettext_additional_targets = ([], 'env'),
|
||||||
|
|
||||||
# XML options
|
# XML options
|
||||||
xml_pretty = (True, 'env'),
|
xml_pretty = (True, 'env'),
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ class Locale(Transform):
|
|||||||
node.children = patch.children
|
node.children = patch.children
|
||||||
node['translated'] = True
|
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.
|
# Extract and translate messages for index entries.
|
||||||
for node, entries in traverse_translatable_index(self.document):
|
for node, entries in traverse_translatable_index(self.document):
|
||||||
new_entries = []
|
new_entries = []
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ keep_warnings = True
|
|||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
html_additional_pages = {'index': 'index.html'}
|
html_additional_pages = {'index': 'index.html'}
|
||||||
release = version = '2013.120'
|
release = version = '2013.120'
|
||||||
gettext_enables = ['index']
|
gettext_additional_targets = ['index']
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ def test_gettext_index_entries(app, status, warning):
|
|||||||
|
|
||||||
|
|
||||||
@with_app('gettext', testroot='intl',
|
@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):
|
def test_gettext_disable_index_entries(app, status, warning):
|
||||||
# regression test for #976
|
# regression test for #976
|
||||||
app.builder.build(['index_entries'])
|
app.builder.build(['index_entries'])
|
||||||
|
|||||||
Reference in New Issue
Block a user