mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Prompt for the document language in sphinx-quickstart.
This commit is contained in:
parent
1d564ace28
commit
336ae30edb
2
CHANGES
2
CHANGES
@ -13,6 +13,8 @@ New features
|
|||||||
* #668: Allow line numbering of ``code-block`` and ``literalinclude`` directives
|
* #668: Allow line numbering of ``code-block`` and ``literalinclude`` directives
|
||||||
to start at an arbitrary line number, with a new ``lineno-start`` option.
|
to start at an arbitrary line number, with a new ``lineno-start`` option.
|
||||||
|
|
||||||
|
* Prompt for the document language in sphinx-quickstart.
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
@ -99,7 +99,10 @@ release = '%(release_str)s'
|
|||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# 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
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
# non-false value, then it is used:
|
# non-false value, then it is used:
|
||||||
@ -320,7 +323,7 @@ epub_copyright = u'%(copyright_str)s'
|
|||||||
#epub_theme = 'epub'
|
#epub_theme = 'epub'
|
||||||
|
|
||||||
# The language of the text. It defaults to the language option
|
# 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 = ''
|
#epub_language = ''
|
||||||
|
|
||||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||||
@ -948,6 +951,7 @@ def ask_user(d):
|
|||||||
* author: author names
|
* author: author names
|
||||||
* version: version of project
|
* version: version of project
|
||||||
* release: release of project
|
* release: release of project
|
||||||
|
* language: document language
|
||||||
* suffix: source file suffix
|
* suffix: source file suffix
|
||||||
* master: master document name
|
* master: master document name
|
||||||
* epub: use epub (bool)
|
* epub: use epub (bool)
|
||||||
@ -1014,6 +1018,18 @@ just set both to the same value.'''
|
|||||||
if 'release' not in d:
|
if 'release' not in d:
|
||||||
do_prompt(d, 'release', 'Project release', d['version'])
|
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:
|
if 'suffix' not in d:
|
||||||
print '''
|
print '''
|
||||||
The file name suffix for source files. Commonly, this is either ".txt"
|
The file name suffix for source files. Commonly, this is either ".txt"
|
||||||
|
@ -170,6 +170,7 @@ def test_quickstart_all_answers(tempdir):
|
|||||||
'Author name': u'Wolfgang Schäuble & G\'Beckstein'.encode('utf-8'),
|
'Author name': u'Wolfgang Schäuble & G\'Beckstein'.encode('utf-8'),
|
||||||
'Project version': '2.0',
|
'Project version': '2.0',
|
||||||
'Project release': '2.0.1',
|
'Project release': '2.0.1',
|
||||||
|
'Project language': 'de',
|
||||||
'Source file suffix': '.txt',
|
'Source file suffix': '.txt',
|
||||||
'Name of your master document': 'contents',
|
'Name of your master document': 'contents',
|
||||||
'autodoc': 'y',
|
'autodoc': 'y',
|
||||||
|
Loading…
Reference in New Issue
Block a user