From c403737ec34d6133cf03198dbb6a10e811e50ce0 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 1 Mar 2014 08:25:22 +0100 Subject: [PATCH] Add versionadded tags for new config values. --- doc/config.rst | 15 ++++++++++----- sphinx/builders/gettext.py | 3 ++- sphinx/config.py | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index 12165cf6e..355cd19d0 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -401,18 +401,23 @@ documentation on :ref:`intl` for details. .. confval:: gettext_uuid - If true, ``sphinx`` generates message catalogs with uuid information - for ``pot`` files. If false, ``sphinx`` doesn't do it. + If true, Sphinx generates uuid information for version tracking in message + catalogs. The default is ``true``. - + + .. versionadded:: 1.3 + .. confval:: gettext_location - If true, ``sphinx`` generates message catalogs with location information - for ``pot`` files. If false, ``sphinx`` doesn't do it. + If true, Sphinx generates location information for messages in message + catalogs. The default is ``true``. + .. versionadded:: 1.3 + + .. _html-options: Options for HTML output diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index d03a070fa..9bb24df8c 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -203,7 +203,8 @@ class MessageCatalogBuilder(I18nBuilder): for source, line, _ in positions)) if self.config.gettext_uuid: # generate "# uuid1\n# uuid2\n ..." - pofile.write(u"# %s\n" % "\n# ".join(uid for _, _, uid in positions)) + pofile.write(u"# %s\n" % "\n# ".join( + uid for _, _, uid in positions)) # message contains *one* line of text ready for translation message = message.replace(u'\\', ur'\\'). \ diff --git a/sphinx/config.py b/sphinx/config.py index 27d8226ed..527ea453d 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -201,8 +201,8 @@ class Config(object): # gettext options gettext_compact = (True, 'gettext'), - gettext_location = (True, None), - gettext_uuid = (True, None), + gettext_location = (True, 'gettext'), + gettext_uuid = (True, 'gettext'), # XML options xml_pretty = (True, 'env'),