From 962b6d459e3d04867fae3dd99ecb60b41dc52288 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 21 Feb 2018 12:58:55 +0900 Subject: [PATCH] Drop `document.settings.gettext_compact` --- CHANGES | 2 ++ doc/extdev/index.rst | 5 +++++ sphinx/environment/__init__.py | 1 - sphinx/transforms/i18n.py | 3 +-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 63b681c1f8..c4069764a7 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,8 @@ Incompatible changes * The default value of :confval:`epub_author` and :confval:`epub_publisher` are changed from ``'unknown'`` to the value of :confval:`author`. This is same as a ``conf.py`` file sphinx-build generates. +* The ``gettext_compact`` attribute is removed from ``document.settings`` + object. Please use ``config.gettext_compact`` instead. Deprecated ---------- diff --git a/doc/extdev/index.rst b/doc/extdev/index.rst index a0b070e48c..78414cd095 100644 --- a/doc/extdev/index.rst +++ b/doc/extdev/index.rst @@ -269,6 +269,11 @@ The following is a list of deprecated interface. - 2.0 - :meth:`~sphinx.application.Sphinx.add_stylesheet()` + * - ``document.settings.gettext_compact`` + - 1.8 + - 1.8 + - :confval:`gettext_compact` + * - ``Sphinx.status_iterator()`` - 1.6 - 1.7 diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 34c99a1f5c..1a8dd6a850 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -540,7 +540,6 @@ class BuildEnvironment(object): """Update settings by new config.""" self.settings['input_encoding'] = config.source_encoding self.settings['trim_footnote_reference_space'] = config.trim_footnote_reference_space - self.settings['gettext_compact'] = config.gettext_compact self.settings['language_code'] = config.language or 'en' # Allow to disable by 3rd party extension (workaround) diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 156c5ac4cf..be7f9af5b4 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -92,8 +92,7 @@ class Locale(SphinxTransform): assert source.startswith(self.env.srcdir) docname = path.splitext(relative_path(path.join(self.env.srcdir, 'dummy'), source))[0] - textdomain = find_catalog(docname, - self.document.settings.gettext_compact) + textdomain = find_catalog(docname, self.config.gettext_compact) # fetch translations dirs = [path.join(self.env.srcdir, directory)