diff --git a/CHANGES b/CHANGES index 4801f3014..b3e2dcfdf 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,8 @@ New features * #668: Allow line numbering of ``code-block`` and ``literalinclude`` directives to start at an arbitrary line number, with a new ``lineno-start`` option. +* Prompt for the document language in sphinx-quickstart. + Bugs fixed ---------- diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index f77e2f22b..ce18c0c10 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -99,7 +99,10 @@ release = '%(release_str)s' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = %(language)r # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -320,7 +323,7 @@ epub_copyright = u'%(copyright_str)s' #epub_theme = 'epub' # The language of the text. It defaults to the language option -# or en if the language is not set. +# or 'en' if the language is not set. #epub_language = '' # The scheme of the identifier. Typical schemes are ISBN or URL. @@ -948,6 +951,7 @@ def ask_user(d): * author: author names * version: version of project * release: release of project + * language: document language * suffix: source file suffix * master: master document name * epub: use epub (bool) @@ -1014,6 +1018,18 @@ just set both to the same value.''' if 'release' not in d: do_prompt(d, 'release', 'Project release', d['version']) + if 'language' not in d: + print ''' +If the documents are to be written in a language other than English, +you can select a language here by its language code. Sphinx will then +translate text that it generates into that language. + +For a list of supported codes, see +http://sphinx-doc.org/config.html#confval-language.''' + do_prompt(d, 'language', 'Project language', 'en') + if d['language'] == 'en': + d['language'] = None + if 'suffix' not in d: print ''' The file name suffix for source files. Commonly, this is either ".txt" diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 9daa74011..7323f48e4 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -170,6 +170,7 @@ def test_quickstart_all_answers(tempdir): 'Author name': u'Wolfgang Schäuble & G\'Beckstein'.encode('utf-8'), 'Project version': '2.0', 'Project release': '2.0.1', + 'Project language': 'de', 'Source file suffix': '.txt', 'Name of your master document': 'contents', 'autodoc': 'y',