diff --git a/doc/config.rst b/doc/config.rst
index 659111968..c3ef00e78 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -99,8 +99,9 @@ General configuration
.. confval:: language
The code for the language the docs are written in. Any text automatically
- generated by Sphinx will be in that language. Default is ``None``, which
- means that no translation will be done.
+ generated by Sphinx will be in that language. Also, in the LaTeX builder, a
+ suitable language will be selected as an option for the *Babel* package.
+ Default is ``None``, which means that no translation will be done.
.. versionadded:: 0.5
diff --git a/sphinx/builder.py b/sphinx/builder.py
index 89581c4ca..f3058bf5e 100644
--- a/sphinx/builder.py
+++ b/sphinx/builder.py
@@ -25,7 +25,7 @@ from docutils.utils import new_document
from docutils.frontend import OptionParser
from docutils.readers.doctree import Reader as DoctreeReader
-from sphinx import addnodes, __version__
+from sphinx import addnodes, locale, __version__
from sphinx.util import ensuredir, relative_uri, SEP, os_path, json
from sphinx.htmlhelp import build_hhx
from sphinx.htmlwriter import HTMLWriter, HTMLTranslator, SmartyPantsHTMLTranslator
@@ -184,6 +184,7 @@ class Builder(object):
if self.translator is None:
self.translator = gettext.NullTranslations()
self.translator.install(unicode=True)
+ locale.init() # translate common labels
def load_env(self):
"""Set up the build environment."""
@@ -1085,9 +1086,9 @@ class ChangesBuilder(Builder):
apichanges.append((entry, docname, lineno))
elif descname or module:
if not module:
- module = 'Builtins'
+ module = _('Builtins')
if not descname:
- descname = 'Module level'
+ descname = _('Module level')
if context:
entry = '%s: %s: %s' % (descname, ttext, context)
else:
diff --git a/sphinx/directives/desc.py b/sphinx/directives/desc.py
index e1e73a871..880f8cd7a 100644
--- a/sphinx/directives/desc.py
+++ b/sphinx/directives/desc.py
@@ -23,14 +23,14 @@ ws_re = re.compile(r'\s+')
def desc_index_text(desctype, module, name):
if desctype == 'function':
if not module:
- return '%s() (built-in function)' % name
- return '%s() (in module %s)' % (name, module)
+ return _('%s() (built-in function)') % name
+ return _('%s() (in module %s)') % (name, module)
elif desctype == 'data':
if not module:
- return '%s (built-in variable)' % name
- return '%s (in module %s)' % (name, module)
+ return _('%s (built-in variable)') % name
+ return _('%s (in module %s)') % (name, module)
elif desctype == 'class':
- return '%s (class in %s)' % (name, module)
+ return _('%s (class in %s)') % (name, module)
elif desctype == 'exception':
return name
elif desctype == 'method':
@@ -38,79 +38,83 @@ def desc_index_text(desctype, module, name):
clsname, methname = name.rsplit('.', 1)
except ValueError:
if module:
- return '%s() (in module %s)' % (name, module)
+ return _('%s() (in module %s)') % (name, module)
else:
return '%s()' % name
if module:
- return '%s() (%s.%s method)' % (methname, module, clsname)
+ return _('%s() (%s.%s method)') % (methname, module, clsname)
else:
- return '%s() (%s method)' % (methname, clsname)
+ return _('%s() (%s method)') % (methname, clsname)
elif desctype == 'staticmethod':
try:
clsname, methname = name.rsplit('.', 1)
except ValueError:
if module:
- return '%s() (in module %s)' % (name, module)
+ return _('%s() (in module %s)') % (name, module)
else:
return '%s()' % name
if module:
- return '%s() (%s.%s static method)' % (methname, module, clsname)
+ return _('%s() (%s.%s static method)') % (methname, module, clsname)
else:
- return '%s() (%s static method)' % (methname, clsname)
+ return _('%s() (%s static method)') % (methname, clsname)
elif desctype == 'attribute':
try:
clsname, attrname = name.rsplit('.', 1)
except ValueError:
if module:
- return '%s (in module %s)' % (name, module)
+ return _('%s (in module %s)') % (name, module)
else:
return name
if module:
- return '%s (%s.%s attribute)' % (attrname, module, clsname)
+ return _('%s (%s.%s attribute)') % (attrname, module, clsname)
else:
- return '%s (%s attribute)' % (attrname, clsname)
+ return _('%s (%s attribute)') % (attrname, clsname)
elif desctype == 'cfunction':
- return '%s (C function)' % name
+ return _('%s (C function)') % name
elif desctype == 'cmember':
- return '%s (C member)' % name
+ return _('%s (C member)') % name
elif desctype == 'cmacro':
- return '%s (C macro)' % name
+ return _('%s (C macro)') % name
elif desctype == 'ctype':
- return '%s (C type)' % name
+ return _('%s (C type)') % name
elif desctype == 'cvar':
- return '%s (C variable)' % name
+ return _('%s (C variable)') % name
else:
- raise ValueError("unhandled descenv: %s" % desctype)
+ raise ValueError('unhandled descenv: %s' % desctype)
# ------ make field lists (like :param foo:) in desc bodies prettier
+_ = lambda x: x # make gettext extraction in constants possible
+
doc_fields_with_arg = {
- 'param': 'param',
- 'parameter': 'param',
- 'arg': 'param',
- 'argument': 'param',
- 'keyword': 'param',
- 'kwarg': 'param',
- 'kwparam': 'param',
- 'type': 'type',
- 'raises': 'Raises',
+ 'param': '%param',
+ 'parameter': '%param',
+ 'arg': '%param',
+ 'argument': '%param',
+ 'keyword': '%param',
+ 'kwarg': '%param',
+ 'kwparam': '%param',
+ 'type': '%type',
+ 'raises': _('Raises'),
'raise': 'Raises',
'exception': 'Raises',
'except': 'Raises',
- 'var': 'Variable',
+ 'var': _('Variable'),
'ivar': 'Variable',
'cvar': 'Variable',
- 'returns': 'Returns',
+ 'returns': _('Returns'),
'return': 'Returns',
}
doc_fields_without_arg = {
'returns': 'Returns',
'return': 'Returns',
- 'rtype': 'Return type',
+ 'rtype': _('Return type'),
}
+del _
+
def handle_doc_fields(node):
# don't traverse, only handle field lists that are immediate children
for child in node.children:
@@ -124,16 +128,16 @@ def handle_doc_fields(node):
fname, fbody = field
try:
typ, obj = fname.astext().split(None, 1)
- typ = doc_fields_with_arg[typ]
+ typ = _(doc_fields_with_arg[typ])
if len(fbody.children) == 1 and \
isinstance(fbody.children[0], nodes.paragraph):
children = fbody.children[0].children
else:
children = fbody.children
- if typ == 'param':
+ if typ == '%param':
if not params:
pfield = nodes.field()
- pfield += nodes.field_name('Parameters', 'Parameters')
+ pfield += nodes.field_name('', _('Parameters'))
pfield += nodes.field_body()
params = nodes.bullet_list()
pfield[1] += params
@@ -141,12 +145,12 @@ def handle_doc_fields(node):
dlitem = nodes.list_item()
dlpar = nodes.paragraph()
dlpar += nodes.emphasis(obj, obj)
- dlpar += nodes.Text(' -- ', ' -- ')
+ dlpar += nodes.Text('', ' -- ')
dlpar += children
param_nodes[obj] = dlpar
dlitem += dlpar
params += dlitem
- elif typ == 'type':
+ elif typ == '%type':
param_types[obj] = fbody.astext()
else:
fieldname = typ + ' ' + obj
@@ -158,7 +162,7 @@ def handle_doc_fields(node):
except (KeyError, ValueError):
fnametext = fname.astext()
try:
- typ = doc_fields_without_arg[fnametext]
+ typ = _(doc_fields_without_arg[fnametext])
except KeyError:
# at least capitalize the field name
typ = fnametext.capitalize()
@@ -299,7 +303,7 @@ def parse_c_signature(signode, sig, desctype):
raise ValueError('no match')
rettype, name, arglist, const = m.groups()
- signode += addnodes.desc_type("", "")
+ signode += addnodes.desc_type('', '')
parse_c_type(signode[-1], rettype)
try:
classname, funcname = name.split('::', 1)
@@ -365,6 +369,7 @@ def parse_option_desc(signode, sig):
def desc_directive(desctype, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
env = state.document.settings.env
+ inode = addnodes.index(entries=[])
node = addnodes.desc()
node['desctype'] = desctype
@@ -394,8 +399,10 @@ def desc_directive(desctype, arguments, options, content, lineno,
targetname = 'cmdoption-' + optname
signode['ids'].append(targetname)
state.document.note_explicit_target(signode)
- env.note_index_entry('pair', 'command line option; %s' % sig,
+ env.note_index_entry('pair', _('command line option; %s') % sig,
targetname, targetname)
+ inode['entries'].append(('pair', _('command line option; %s') % sig,
+ targetname, targetname))
env.note_reftarget('option', optname, targetname)
continue
elif desctype == 'describe':
@@ -417,7 +424,7 @@ def desc_directive(desctype, arguments, options, content, lineno,
signode['ids'].append(targetname)
state.document.note_explicit_target(signode)
if indextemplate:
- indexentry = indextemplate % (fullname,)
+ indexentry = _(indextemplate) % (fullname,)
indextype = 'single'
colon = indexentry.find(':')
if colon != -1:
@@ -425,6 +432,8 @@ def desc_directive(desctype, arguments, options, content, lineno,
indexentry = indexentry[colon+1:].strip()
env.note_index_entry(indextype, indexentry,
targetname, targetname)
+ inode['entries'].append((indextype, indexentry,
+ targetname, targetname))
env.note_reftarget(rolename, fullname, targetname)
# don't use object indexing below
continue
@@ -446,9 +455,9 @@ def desc_directive(desctype, arguments, options, content, lineno,
env.note_descref(fullname, desctype, lineno)
names.append(name)
- env.note_index_entry('single',
- desc_index_text(desctype, module, name),
- fullname, fullname)
+ indextext = desc_index_text(desctype, module, name)
+ env.note_index_entry('single', indextext, fullname, fullname)
+ inode['entries'].append(('single', indextext, fullname, fullname))
subnode = addnodes.desc_content()
# needed for automatic qualification of members
@@ -469,7 +478,7 @@ def desc_directive(desctype, arguments, options, content, lineno,
env.currclass = None
env.currdesc = None
node.append(subnode)
- return [node]
+ return [inode, node]
desc_directive.content = 1
desc_directive.arguments = (1, 0, 1)
@@ -501,13 +510,17 @@ desctypes = [
for _name in desctypes:
directives.register_directive(_name, desc_directive)
+_ = lambda x: x
+
# Generic cross-reference types; they can be registered in the application;
# the directives are either desc_directive or target_directive
additional_xref_types = {
# directive name: (role name, index text, function to parse the desc node)
- 'envvar': ('envvar', 'environment variable; %s', None),
+ 'envvar': ('envvar', _('environment variable; %s'), None),
}
+del _
+
# ------ target --------------------------------------------------------------------
@@ -521,6 +534,7 @@ def target_directive(targettype, arguments, options, content, lineno,
targetname = '%s-%s' % (rolename, fullname)
node = nodes.target('', '', ids=[targetname])
state.document.note_explicit_target(node)
+ ret = [node]
if indextemplate:
indexentry = indextemplate % (fullname,)
indextype = 'single'
@@ -529,8 +543,10 @@ def target_directive(targettype, arguments, options, content, lineno,
indextype = indexentry[:colon].strip()
indexentry = indexentry[colon+1:].strip()
env.note_index_entry(indextype, indexentry, targetname, targetname)
+ inode = addnodes.index(entries=[(indextype, indexentry, targetname, targetname)])
+ ret.insert(0, inode)
env.note_reftarget(rolename, fullname, targetname)
- return [node]
+ return ret
target_directive.content = 0
target_directive.arguments = (1, 0, 1)
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index fab2f5462..b4ddf1d04 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -16,6 +16,7 @@ from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.util import patfilter
from sphinx.roles import caption_ref_re
+from sphinx.locale import pairindextypes
from sphinx.util.compat import make_admonition
@@ -98,13 +99,16 @@ def module_directive(name, arguments, options, content, lineno,
if 'platform' in options:
modulenode['platform'] = options['platform']
node = nodes.paragraph()
- node += nodes.emphasis('Platforms: ', 'Platforms: ')
+ node += nodes.emphasis('', _('Platforms: '))
node += nodes.Text(options['platform'], options['platform'])
ret.append(node)
# the synopsis isn't printed; in fact, it is only used in the modindex currently
if not noindex:
- env.note_index_entry('single', '%s (module)' % modname,
- 'module-' + modname, modname)
+ indextext = _('%s (module)') % modname
+ env.note_index_entry('single', indextext, 'module-' + modname, modname)
+ inode = addnodes.index(entries=[('single', indextext,
+ 'module-' + modname, modname)])
+ ret.insert(0, inode)
return ret
module_directive.arguments = (1, 0, 0)
@@ -141,11 +145,11 @@ def author_directive(name, arguments, options, content, lineno,
emph = nodes.emphasis()
para += emph
if name == 'sectionauthor':
- text = 'Section author: '
+ text = _('Section author: ')
elif name == 'moduleauthor':
- text = 'Module author: '
+ text = _('Module author: ')
else:
- text = 'Author: '
+ text = _('Author: ')
emph += nodes.Text(text, text)
inodes, messages = state.inline_text(arguments[0], lineno)
emph.extend(inodes)
@@ -158,9 +162,8 @@ directives.register_directive('moduleauthor', author_directive)
# ------ index markup --------------------------------------------------------------
-entrytypes = [
- 'single', 'pair', 'triple', 'module', 'keyword', 'operator',
- 'object', 'exception', 'statement', 'builtin',
+indextypes = [
+ 'single', 'pair', 'triple',
]
def index_directive(name, arguments, options, content, lineno,
@@ -175,17 +178,26 @@ def index_directive(name, arguments, options, content, lineno,
indexnode['entries'] = ne = []
for entry in arguments:
entry = entry.strip()
- for type in entrytypes:
+ for type in pairindextypes:
if entry.startswith(type+':'):
value = entry[len(type)+1:].strip()
+ value = pairindextypes[type] + '; ' + value
env.note_index_entry(type, value, targetid, value)
ne.append((type, value, targetid, value))
break
- # shorthand notation for single entries
else:
- for value in entry.split(','):
- env.note_index_entry('single', value.strip(), targetid, value.strip())
- ne.append(('single', value.strip(), targetid, value.strip()))
+ for type in indextypes:
+ if entry.startswith(type+':'):
+ value = entry[len(type)+1:].strip()
+ env.note_index_entry(type, value, targetid, value)
+ ne.append((type, value, targetid, value))
+ break
+ # shorthand notation for single entries
+ else:
+ for value in entry.split(','):
+ env.note_index_entry('single', value.strip(),
+ targetid, value.strip())
+ ne.append(('single', value.strip(), targetid, value.strip()))
return [indexnode, targetnode]
index_directive.arguments = (1, 0, 1)
@@ -223,7 +235,7 @@ directives.register_directive('versionchanged', version_directive)
def seealso_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
rv = make_admonition(
- addnodes.seealso, name, ['See also'], options, content,
+ addnodes.seealso, name, [_('See also')], options, content,
lineno, content_offset, block_text, state, state_machine)
return rv
@@ -292,7 +304,7 @@ directives.register_directive('productionlist', productionlist_directive)
def glossary_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
- """Glossary with cross-reference targets for :dfn: roles."""
+ """Glossary with cross-reference targets for :term: roles."""
env = state.document.settings.env
node = addnodes.glossary()
state.nested_parse(content, content_offset, node)
diff --git a/sphinx/environment.py b/sphinx/environment.py
index 41e9ac97f..162ed6d44 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -1051,13 +1051,6 @@ class BuildEnvironment:
add_entry(first, second+' '+third)
add_entry(second, third+', '+first)
add_entry(third, first+' '+second)
- elif type in ('module', 'keyword', 'operator', 'object',
- 'exception', 'statement'):
- add_entry(string, type)
- add_entry(type, string)
- elif type == 'builtin':
- add_entry(string, 'built-in function')
- add_entry('built-in function', string)
else:
self.warn(fn, "unknown index entry type %r" % type)
diff --git a/sphinx/htmlhelp.py b/sphinx/htmlhelp.py
index a3ace5dd8..ea21d0ce1 100644
--- a/sphinx/htmlhelp.py
+++ b/sphinx/htmlhelp.py
@@ -152,7 +152,8 @@ def build_hhx(builder, outdir, outname):
f.write('
' + object_sitemap % (builder.config.html_short_title,
'index.html'))
if builder.config.html_use_modindex:
- f.write(' ' + object_sitemap % ('Global Module Index', 'modindex.html'))
+ f.write(' ' + object_sitemap % (_('Global Module Index'),
+ 'modindex.html'))
# the TOC
tocdoc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder,
prune_toctrees=False)
diff --git a/sphinx/htmlwriter.py b/sphinx/htmlwriter.py
index 5fadcb1d6..8eb3dad4f 100644
--- a/sphinx/htmlwriter.py
+++ b/sphinx/htmlwriter.py
@@ -15,6 +15,7 @@ import posixpath
from docutils import nodes
from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
+from sphinx.locale import admonitionlabels, versionlabels
from sphinx.highlighting import PygmentsBridge
from sphinx.util.smartypants import sphinx_smarty_pants
@@ -38,12 +39,6 @@ class HTMLWriter(Writer):
setattr(self, attr, getattr(visitor, attr, None))
-version_text = {
- 'deprecated': 'Deprecated in version %s',
- 'versionchanged': 'Changed in version %s',
- 'versionadded': 'New in version %s',
-}
-
class HTMLTranslator(BaseTranslator):
"""
Our custom HTML translator.
@@ -74,7 +69,8 @@ class HTMLTranslator(BaseTranslator):
def depart_desc_signature(self, node):
if node['ids'] and self.builder.add_definition_links:
self.body.append(u'')
+ u'title="%s">\u00B6' %
+ _('Permalink to this definition'))
self.body.append('\n')
def visit_desc_addname(self, node):
@@ -131,7 +127,7 @@ class HTMLTranslator(BaseTranslator):
def visit_versionmodified(self, node):
self.body.append(self.starttag(node, 'p'))
- text = version_text[node['type']] % node['version']
+ text = versionlabels[node['type']] % node['version']
if len(node):
text += ': '
else:
@@ -160,7 +156,7 @@ class HTMLTranslator(BaseTranslator):
self.body.append(self.starttag(
node, 'div', CLASS=('admonition ' + name)))
if name and name != 'seealso':
- node.insert(0, nodes.title(name, self.language.labels[name]))
+ node.insert(0, nodes.title(name, admonitionlabels[name]))
self.set_first_last(node)
def visit_seealso(self, node):
@@ -379,11 +375,12 @@ class HTMLTranslator(BaseTranslator):
aname = node.parent['ids'][0]
# add permalink anchor
self.body.append(u'')
+ u'title="%s">\u00B6' %
+ _('Permalink to this headline'))
BaseTranslator.depart_title(self, node)
def unknown_visit(self, node):
- raise NotImplementedError("Unknown node: " + node.__class__.__name__)
+ raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
class SmartyPantsHTMLTranslator(HTMLTranslator):
diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py
index 2a073bc35..0f49d0c92 100644
--- a/sphinx/latexwriter.py
+++ b/sphinx/latexwriter.py
@@ -18,24 +18,35 @@ import time
from os import path
from docutils import nodes, writers
+from docutils.writers.latex2e import Babel
from sphinx import addnodes
from sphinx import highlighting
+from sphinx.locale import admonitionlabels, versionlabels
from sphinx.util.smartypants import educateQuotesLatex
HEADER = r'''%% Generated by Sphinx.
-\documentclass[%(papersize)s,%(pointsize)s]{%(docclass)s}
+\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(docclass)s}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
+\usepackage{babel}
\title{%(title)s}
\date{%(date)s}
\release{%(release)s}
\author{%(author)s}
\newcommand{\sphinxlogo}{%(logo)s}
+\renewcommand{\releasename}{%(releasename)s}
%(preamble)s
\makeindex
'''
+BEGIN_DOC = r'''
+\begin{document}
+\shorthandoff{"}
+\maketitle
+\tableofcontents
+'''
+
FOOTER = r'''
\printindex
\end{document}
@@ -121,9 +132,14 @@ class LaTeXTranslator(nodes.NodeVisitor):
# if empty, the title is set to the first section title
'title': document.settings.title,
'release': builder.config.release,
+ 'releasename': _('Release'),
'logo': logo,
'date': date,
+ 'classoptions': '',
}
+ if builder.config.language:
+ babel = Babel(builder.config.language)
+ self.options['classoptions'] += ',' + babel.get_language()
self.highlighter = highlighting.PygmentsBridge(
'latex', builder.config.pygments_style)
self.context = []
@@ -159,15 +175,15 @@ class LaTeXTranslator(nodes.NodeVisitor):
'\n\n' + \
u''.join(self.body) + \
(self.options['modindex'] and
- '\\renewcommand{\\indexname}{Module Index}'
- '\\printmodindex'
- '\\renewcommand{\\indexname}{Index}\n' or '') + \
+ ('\\renewcommand{\\indexname}{%s}' % _('Module index') +
+ '\\printmodindex' +
+ '\\renewcommand{\\indexname}{%s}\n' % _('Index')) or '') + \
(FOOTER % self.options)
def visit_document(self, node):
if self.first_document == 1:
# the first document is all the regular content ...
- self.body.append('\\begin{document}\n\\maketitle\n\\tableofcontents\n')
+ self.body.append(BEGIN_DOC)
self.first_document = 0
elif self.first_document == 0:
# ... and all others are the appendices
@@ -417,9 +433,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
pass
def visit_seealso(self, node):
- self.body.append("\n\n\\begin{seealso}\n")
+ self.body.append("\n\n\\strong{%s:}\n\n" % admonitionlabels['seealso'])
def depart_seealso(self, node):
- self.body.append("\n\\end{seealso}\n")
+ self.body.append("\n\n")
def visit_rubric(self, node):
if len(node.children) == 1 and node.children[0].astext() == 'Footnotes':
@@ -715,7 +731,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
def _make_visit_admonition(name):
def visit_admonition(self, node):
- self.body.append('\n\\begin{notice}[%s]' % name)
+ self.body.append('\n\\begin{notice}{%s}{%s:}' %
+ (name, admonitionlabels[name]))
return visit_admonition
def _depart_named_admonition(self, node):
self.body.append('\\end{notice}\n')
@@ -740,19 +757,14 @@ class LaTeXTranslator(nodes.NodeVisitor):
depart_warning = _depart_named_admonition
def visit_versionmodified(self, node):
- self.body.append('\\%s' % node['type'])
- if node['type'] == 'deprecated':
- self.body.append('{%s}{' % node['version'])
- self.context.append('}')
+ intro = versionlabels[node['type']] % node['version']
+ if node.children:
+ intro += ': '
else:
- if len(node):
- self.body.append('[')
- self.context.append(']{%s}' % node['version'])
- else:
- self.body.append('{%s}' % node['version'])
- self.context.append('')
+ intro += '.'
+ self.body.append(intro)
def depart_versionmodified(self, node):
- self.body.append(self.context.pop())
+ pass
def visit_target(self, node):
def add_target(id):
@@ -781,16 +793,6 @@ class LaTeXTranslator(nodes.NodeVisitor):
def depart_attribution(self, node):
self.body.append('\n\\end{flushright}\n')
- indextype_map = {
- 'module': 'refmodindex',
- 'keyword': 'kwindex',
- 'operator': 'opindex',
- 'object': 'obindex',
- 'exception': 'exindex',
- 'statement': 'stindex',
- 'builtin': 'bifuncindex',
- }
-
def visit_index(self, node, scre=re.compile(r';\s*')):
entries = node['entries']
for type, string, tid, _ in entries:
@@ -802,9 +804,6 @@ class LaTeXTranslator(nodes.NodeVisitor):
elif type == 'triple':
parts = tuple(self.encode(x.strip()) for x in string.split(';', 2))
self.body.append(r'\indexiii{%s}{%s}{%s}' % parts)
- elif type in self.indextype_map:
- self.body.append(r'\%s{%s}' % (self.indextype_map[type],
- self.encode(string)))
else:
self.builder.warn('unknown index entry type %s found' % type)
raise nodes.SkipNode
diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py
new file mode 100644
index 000000000..bedade3c9
--- /dev/null
+++ b/sphinx/locale/__init__.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.locale
+ ~~~~~~~~~~~~~
+
+ Locale utilities.
+
+ :copyright: 2008 by Georg Brandl.
+ :license: BSD.
+"""
+
+_ = lambda x: x
+
+admonitionlabels = {
+ 'attention': _('Attention'),
+ 'caution': _('Caution'),
+ 'danger': _('Danger'),
+ 'error': _('Error'),
+ 'hint': _('Hint'),
+ 'important': _('Important'),
+ 'note': _('Note'),
+ 'seealso': _('See Also'),
+ 'tip': _('Tip'),
+ 'warning': _('Warning'),
+}
+
+versionlabels = {
+ 'versionadded': _('New in version %s'),
+ 'versionchanged': _('Changed in version %s'),
+ 'deprecated': _('Deprecated since version %s'),
+}
+
+pairindextypes = {
+ 'module': _('module'),
+ 'keyword': _('keyword'),
+ 'operator': _('operator'),
+ 'object': _('object'),
+ 'exception': _('exception'),
+ 'statement': _('statement'),
+ 'builtin': _('built-in function'),
+}
+
+del _
+
+def init():
+ for dct in (admonitionlabels, versionlabels, pairindextypes):
+ for key in dct:
+ dct[key] = _(dct[key])
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
index 2d9586a4e..169bcad18 100644
Binary files a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo and b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo differ
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.po b/sphinx/locale/cs/LC_MESSAGES/sphinx.po
index e6eb29e67..783ca3bdf 100644
--- a/sphinx/locale/cs/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.po
@@ -1,4 +1,4 @@
-# Translations template for Sphinx.
+# Czech translations for Sphinx.
# Copyright (C) 2008 ORGANIZATION
# This file is distributed under the same license as the Sphinx project.
# FIRST AUTHOR , 2008.
@@ -8,55 +8,317 @@ msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-08-08 12:39+0000\n"
-"PO-Revision-Date: 2008-08-08 15:43+0100\n"
+"PO-Revision-Date: 2008-08-10 11:43+0000\n"
"Last-Translator: Pavel Kosina \n"
"Language-Team: Pavel Kosina \n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
+"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.3\n"
-"X-Poedit-Language: Czech\n"
-"X-Poedit-Country: CZECH REPUBLIC\n"
-#: sphinx/builder.py:390
+#: sphinx/builder.py:391
#, python-format
msgid "%b %d, %Y"
msgstr "%d.%m.%Y"
-#: sphinx/builder.py:409
-#: sphinx/templates/defindex.html:21
+#: sphinx/builder.py:410 sphinx/templates/defindex.html:21
msgid "General Index"
msgstr "Generální index"
-#: sphinx/builder.py:409
+#: sphinx/builder.py:410
msgid "index"
msgstr "index"
-#: sphinx/builder.py:411
-#: sphinx/templates/defindex.html:19
-#: sphinx/templates/modindex.html:2
+#: sphinx/builder.py:412 sphinx/htmlhelp.py:155
+#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2
#: sphinx/templates/modindex.html:12
msgid "Global Module Index"
msgstr "Index modulů"
-#: sphinx/builder.py:411
+#: sphinx/builder.py:412
msgid "modules"
msgstr "moduly"
-#: sphinx/builder.py:447
+#: sphinx/builder.py:448
msgid "next"
msgstr "další"
-#: sphinx/builder.py:454
+#: sphinx/builder.py:455
msgid "previous"
msgstr "předchozí"
-#: sphinx/environment.py:108
-#: sphinx/latexwriter.py:110
+#: sphinx/builder.py:1089
+msgid "Builtins"
+msgstr ""
+
+#: sphinx/builder.py:1091
+#, fuzzy
+msgid "Module level"
+msgstr "moduly"
+
+#: sphinx/environment.py:108 sphinx/latexwriter.py:114
#, python-format
msgid "%B %d, %Y"
msgstr "%d.%m.%Y"
+#: sphinx/htmlwriter.py:73
+msgid "Permalink to this definition"
+msgstr ""
+
+#: sphinx/htmlwriter.py:379
+msgid "Permalink to this headline"
+msgstr ""
+
+#: sphinx/latexwriter.py:128
+msgid "Release"
+msgstr ""
+
+#: sphinx/latexwriter.py:171
+msgid "Module index"
+msgstr "Index modulů"
+
+#: sphinx/latexwriter.py:173 sphinx/templates/genindex-single.html:2
+#: sphinx/templates/genindex-split.html:2
+#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2
+#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48
+msgid "Index"
+msgstr "Index"
+
+#: sphinx/roles.py:52 sphinx/roles.py:55 sphinx/directives/desc.py:519
+#, python-format
+msgid "environment variable; %s"
+msgstr ""
+
+#: sphinx/roles.py:61 sphinx/roles.py:64
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr ""
+
+#: sphinx/textwriter.py:151
+#, python-format
+msgid "Platform: %s"
+msgstr ""
+
+#: sphinx/textwriter.py:353
+msgid "[image]"
+msgstr ""
+
+#: sphinx/directives/desc.py:26
+#, python-format
+msgid "%s() (built-in function)"
+msgstr ""
+
+#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41
+#: sphinx/directives/desc.py:53
+#, python-format
+msgid "%s() (in module %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:30
+#, python-format
+msgid "%s (built-in variable)"
+msgstr ""
+
+#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65
+#, python-format
+msgid "%s (in module %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:33
+#, python-format
+msgid "%s (class in %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:45
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:47
+#, python-format
+msgid "%s() (%s method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:57
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:59
+#, python-format
+msgid "%s() (%s static method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:69
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr ""
+
+#: sphinx/directives/desc.py:71
+#, python-format
+msgid "%s (%s attribute)"
+msgstr ""
+
+#: sphinx/directives/desc.py:73
+#, python-format
+msgid "%s (C function)"
+msgstr ""
+
+#: sphinx/directives/desc.py:75
+#, python-format
+msgid "%s (C member)"
+msgstr ""
+
+#: sphinx/directives/desc.py:77
+#, python-format
+msgid "%s (C macro)"
+msgstr ""
+
+#: sphinx/directives/desc.py:79
+#, python-format
+msgid "%s (C type)"
+msgstr ""
+
+#: sphinx/directives/desc.py:81
+#, python-format
+msgid "%s (C variable)"
+msgstr ""
+
+#: sphinx/directives/desc.py:99
+msgid "Raises"
+msgstr ""
+
+#: sphinx/directives/desc.py:103
+msgid "Variable"
+msgstr ""
+
+#: sphinx/directives/desc.py:106
+msgid "Returns"
+msgstr ""
+
+#: sphinx/directives/desc.py:113
+msgid "Return type"
+msgstr ""
+
+#: sphinx/directives/desc.py:140
+msgid "Parameters"
+msgstr ""
+
+#: sphinx/directives/desc.py:402 sphinx/directives/desc.py:404
+#, python-format
+msgid "command line option; %s"
+msgstr ""
+
+#: sphinx/directives/other.py:102
+msgid "Platforms: "
+msgstr ""
+
+#: sphinx/directives/other.py:107
+#, python-format
+msgid "%s (module)"
+msgstr "%s (moduly)"
+
+#: sphinx/directives/other.py:148
+msgid "Section author: "
+msgstr ""
+
+#: sphinx/directives/other.py:150
+msgid "Module author: "
+msgstr ""
+
+#: sphinx/directives/other.py:152
+msgid "Author: "
+msgstr ""
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr ""
+
+#: sphinx/locale/__init__.py:15
+msgid "Attention"
+msgstr ""
+
+#: sphinx/locale/__init__.py:16
+msgid "Caution"
+msgstr ""
+
+#: sphinx/locale/__init__.py:17
+msgid "Danger"
+msgstr ""
+
+#: sphinx/locale/__init__.py:18
+msgid "Error"
+msgstr ""
+
+#: sphinx/locale/__init__.py:19
+msgid "Hint"
+msgstr ""
+
+#: sphinx/locale/__init__.py:20
+msgid "Important"
+msgstr ""
+
+#: sphinx/locale/__init__.py:21
+msgid "Note"
+msgstr ""
+
+#: sphinx/locale/__init__.py:22
+msgid "See Also"
+msgstr ""
+
+#: sphinx/locale/__init__.py:23
+msgid "Tip"
+msgstr ""
+
+#: sphinx/locale/__init__.py:24
+msgid "Warning"
+msgstr ""
+
+#: sphinx/locale/__init__.py:28
+#, python-format
+msgid "New in version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:29
+#, python-format
+msgid "Changed in version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:30
+#, python-format
+msgid "Deprecated since version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:34
+msgid "module"
+msgstr "moduly"
+
+#: sphinx/locale/__init__.py:35
+msgid "keyword"
+msgstr ""
+
+#: sphinx/locale/__init__.py:36
+msgid "operator"
+msgstr ""
+
+#: sphinx/locale/__init__.py:37
+msgid "object"
+msgstr ""
+
+#: sphinx/locale/__init__.py:38
+msgid "exception"
+msgstr ""
+
+#: sphinx/locale/__init__.py:39
+msgid "statement"
+msgstr ""
+
+#: sphinx/locale/__init__.py:40
+msgid "built-in function"
+msgstr ""
+
#: sphinx/templates/defindex.html:2
msgid "Overview"
msgstr "Přehled"
@@ -89,28 +351,14 @@ msgstr "rychlý přístup ke všem modulům"
msgid "all functions, classes, terms"
msgstr "všechny funkce, třídy, termíny"
-#: sphinx/templates/genindex-single.html:2
-#: sphinx/templates/genindex-split.html:2
-#: sphinx/templates/genindex-split.html:5
-#: sphinx/templates/genindex.html:2
-#: sphinx/templates/genindex.html:5
-#: sphinx/templates/genindex.html:48
-msgid "Index"
-msgstr "Index"
-
#: sphinx/templates/genindex-single.html:5
#, python-format
msgid "Index – %(key)s"
msgstr "Index – %(key)s"
-#: sphinx/templates/genindex-single.html:14
-msgid "Link"
-msgstr "Odkaz"
-
#: sphinx/templates/genindex-single.html:44
#: sphinx/templates/genindex-split.html:14
-#: sphinx/templates/genindex-split.html:27
-#: sphinx/templates/genindex.html:54
+#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54
msgid "Full index on one page"
msgstr "Plný index na jedné stránce"
@@ -154,8 +402,7 @@ msgstr "Tato stránka"
msgid "Suggest Change"
msgstr "Návrh změnu"
-#: sphinx/templates/layout.html:60
-#: sphinx/templates/layout.html:62
+#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62
msgid "Show Source"
msgstr "Ukázat zdroj"
@@ -192,8 +439,7 @@ msgstr "Celkový obsah"
msgid "Global index"
msgstr "Celkový index"
-#: sphinx/templates/layout.html:131
-#: sphinx/templates/search.html:2
+#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2
#: sphinx/templates/search.html:5
msgid "Search"
msgstr "Hledání"
@@ -219,8 +465,12 @@ msgstr "Naposledy aktualizováno dne %(last_updated)s."
#: sphinx/templates/layout.html:186
#, python-format
-msgid "Created using Sphinx %(sphinx_version)s."
-msgstr "vytvořeno pomocí Sphinx %(sphinx_version)s."
+msgid ""
+"Created using Sphinx "
+"%(sphinx_version)s."
+msgstr ""
+"vytvořeno pomocí Sphinx "
+"%(sphinx_version)s."
#: sphinx/templates/modindex.html:14
msgid "Most popular modules:"
@@ -240,8 +490,14 @@ msgid "Search %(docstitle)s"
msgstr "Prohledat %(docstitle)s"
#: sphinx/templates/page.html:8
-msgid "Note: You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one."
-msgstr "Note: You requested an out-of-date URL from this server. We've tried to redirect you to the new location of this page, but it may not be the right one."
+msgid ""
+"Note: You requested an out-of-date URL from this server."
+" We've tried to redirect you to the new location of this page, but it may"
+" not be the right one."
+msgstr ""
+"Note: You requested an out-of-date URL from this server."
+" We've tried to redirect you to the new location of this page, but it may"
+" not be the right one."
#: sphinx/templates/search.html:7
msgid ""
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
index ce33ab0b3..8fda8b6e3 100644
Binary files a/sphinx/locale/de/LC_MESSAGES/sphinx.mo and b/sphinx/locale/de/LC_MESSAGES/sphinx.mo differ
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po
index c55c93674..3cea82149 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po
@@ -1,14 +1,13 @@
# German translations for Sphinx.
-# Copyright (C) 2008 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# , 2008.
+# Copyright (C) 2008 Translators.
+# This file is distributed under the same license as the Sphinx project.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-08-07 21:40+0200\n"
-"PO-Revision-Date: 2008-08-08 12:40+0000\n"
+"PO-Revision-Date: 2008-08-10 11:43+0000\n"
"Last-Translator: Horst Gutmann \n"
"Language-Team: de \n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -17,40 +16,305 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.3\n"
-#: sphinx/builder.py:390
-#, fuzzy, python-format
+#: sphinx/builder.py:391
+#, python-format
msgid "%b %d, %Y"
-msgstr "%d.%b.%Y"
+msgstr "%d. %m. %Y"
-#: sphinx/builder.py:409 sphinx/templates/defindex.html:21
+#: sphinx/builder.py:410 sphinx/templates/defindex.html:21
msgid "General Index"
msgstr "Allgemeiner Index"
-#: sphinx/builder.py:409
+#: sphinx/builder.py:410
msgid "index"
msgstr "Index"
-#: sphinx/builder.py:411 sphinx/templates/defindex.html:19
-#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:12
+#: sphinx/builder.py:412 sphinx/htmlhelp.py:155
+#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2
+#: sphinx/templates/modindex.html:12
msgid "Global Module Index"
msgstr "Globaler Modulindex"
-#: sphinx/builder.py:411
+#: sphinx/builder.py:412
msgid "modules"
msgstr "Module"
-#: sphinx/builder.py:447
+#: sphinx/builder.py:448
msgid "next"
msgstr "weiter"
-#: sphinx/builder.py:454
+#: sphinx/builder.py:455
msgid "previous"
msgstr "zurück"
-#: sphinx/environment.py:108 sphinx/latexwriter.py:110
+#: sphinx/builder.py:1089
+msgid "Builtins"
+msgstr "Builtins"
+
+#: sphinx/builder.py:1091
+msgid "Module level"
+msgstr "Modulebene"
+
+#: sphinx/environment.py:108 sphinx/latexwriter.py:114
#, python-format
msgid "%B %d, %Y"
-msgstr "%d.%b.%Y"
+msgstr "%d. %m. %Y"
+
+#: sphinx/htmlwriter.py:73
+msgid "Permalink to this definition"
+msgstr "Permalink zu dieser Definition"
+
+#: sphinx/htmlwriter.py:379
+msgid "Permalink to this headline"
+msgstr "Permalink zu dieser Überschrift"
+
+#: sphinx/latexwriter.py:128
+msgid "Release"
+msgstr "Release"
+
+#: sphinx/latexwriter.py:171
+msgid "Module index"
+msgstr "Modulindex"
+
+#: sphinx/latexwriter.py:173 sphinx/templates/genindex-single.html:2
+#: sphinx/templates/genindex-split.html:2
+#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2
+#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48
+msgid "Index"
+msgstr "Stichwortverzeichnis"
+
+#: sphinx/roles.py:52 sphinx/roles.py:55 sphinx/directives/desc.py:519
+#, python-format
+msgid "environment variable; %s"
+msgstr "Umgebungsvariable; %s"
+
+#: sphinx/roles.py:61 sphinx/roles.py:64
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python Enhancement Proposals!PEP %s"
+
+#: sphinx/textwriter.py:151
+#, python-format
+msgid "Platform: %s"
+msgstr "Plattform: %s"
+
+#: sphinx/textwriter.py:353
+msgid "[image]"
+msgstr "[Bild]"
+
+#: sphinx/directives/desc.py:26
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (eingebaute Funktion)"
+
+#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41
+#: sphinx/directives/desc.py:53
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (in Modul %s)"
+
+#: sphinx/directives/desc.py:30
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (eingebaute Variable)"
+
+#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s (in Modul %s)"
+
+#: sphinx/directives/desc.py:33
+#, python-format
+msgid "%s (class in %s)"
+msgstr "%s (Klasse in %s)"
+
+#: sphinx/directives/desc.py:45
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (Methode von %s.%s)"
+
+#: sphinx/directives/desc.py:47
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (Methode von %s)"
+
+#: sphinx/directives/desc.py:57
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (statische Methode von %s.%s)"
+
+#: sphinx/directives/desc.py:59
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (statische Methode von %s)"
+
+#: sphinx/directives/desc.py:69
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (Attribut von %s.%s)"
+
+#: sphinx/directives/desc.py:71
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (Attribut von %s)"
+
+#: sphinx/directives/desc.py:73
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C-Funktion)"
+
+#: sphinx/directives/desc.py:75
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C-Member)"
+
+#: sphinx/directives/desc.py:77
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C-Makro)"
+
+#: sphinx/directives/desc.py:79
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C-Typ)"
+
+#: sphinx/directives/desc.py:81
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C-Variable)"
+
+#: sphinx/directives/desc.py:99
+msgid "Raises"
+msgstr "Verursacht:"
+
+#: sphinx/directives/desc.py:103
+msgid "Variable"
+msgstr "Variable"
+
+#: sphinx/directives/desc.py:106
+msgid "Returns"
+msgstr "Rückgabe"
+
+#: sphinx/directives/desc.py:113
+msgid "Return type"
+msgstr "Rückgabetyp"
+
+#: sphinx/directives/desc.py:140
+msgid "Parameters"
+msgstr "Parameter"
+
+#: sphinx/directives/desc.py:402 sphinx/directives/desc.py:404
+#, python-format
+msgid "command line option; %s"
+msgstr "Kommandozeilenoption; %s"
+
+#: sphinx/directives/other.py:102
+msgid "Platforms: "
+msgstr "Plattformen: "
+
+#: sphinx/directives/other.py:107
+#, python-format
+msgid "%s (module)"
+msgstr "%s (Modul)"
+
+#: sphinx/directives/other.py:148
+msgid "Section author: "
+msgstr "Autor des Abschnitts: "
+
+#: sphinx/directives/other.py:150
+msgid "Module author: "
+msgstr "Autor des Moduls: "
+
+#: sphinx/directives/other.py:152
+msgid "Author: "
+msgstr "Autor: "
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr "Siehe auch"
+
+#: sphinx/locale/__init__.py:15
+msgid "Attention"
+msgstr "Achtung"
+
+#: sphinx/locale/__init__.py:16
+msgid "Caution"
+msgstr "Vorsicht"
+
+#: sphinx/locale/__init__.py:17
+msgid "Danger"
+msgstr "Gefahr"
+
+#: sphinx/locale/__init__.py:18
+msgid "Error"
+msgstr "Fehler"
+
+#: sphinx/locale/__init__.py:19
+msgid "Hint"
+msgstr "Hinweis"
+
+#: sphinx/locale/__init__.py:20
+msgid "Important"
+msgstr "Wichtig"
+
+#: sphinx/locale/__init__.py:21
+msgid "Note"
+msgstr "Bemerkung"
+
+#: sphinx/locale/__init__.py:22
+msgid "See Also"
+msgstr "Siehe auch"
+
+#: sphinx/locale/__init__.py:23
+msgid "Tip"
+msgstr "Tipp"
+
+#: sphinx/locale/__init__.py:24
+msgid "Warning"
+msgstr "Warnung"
+
+#: sphinx/locale/__init__.py:28
+#, python-format
+msgid "New in version %s"
+msgstr "Neu in Version %s"
+
+#: sphinx/locale/__init__.py:29
+#, python-format
+msgid "Changed in version %s"
+msgstr "Geändert in Version %s"
+
+#: sphinx/locale/__init__.py:30
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "Veraltet ab Version %s"
+
+#: sphinx/locale/__init__.py:34
+msgid "module"
+msgstr "Module"
+
+#: sphinx/locale/__init__.py:35
+msgid "keyword"
+msgstr "Schlüsselwort"
+
+#: sphinx/locale/__init__.py:36
+msgid "operator"
+msgstr "Operator"
+
+#: sphinx/locale/__init__.py:37
+msgid "object"
+msgstr "Objekt"
+
+#: sphinx/locale/__init__.py:38
+msgid "exception"
+msgstr "Exception"
+
+#: sphinx/locale/__init__.py:39
+msgid "statement"
+msgstr "Statement"
+
+#: sphinx/locale/__init__.py:40
+msgid "built-in function"
+msgstr "eingebaute Funktion"
#: sphinx/templates/defindex.html:2
msgid "Overview"
@@ -84,22 +348,11 @@ msgstr "Schneller Zugriff auf alle Module"
msgid "all functions, classes, terms"
msgstr "Alle Funktionen, Klassen, Begriffe"
-#: sphinx/templates/genindex-single.html:2
-#: sphinx/templates/genindex-split.html:2
-#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2
-#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48
-msgid "Index"
-msgstr "Stichwortverzeichnis"
-
#: sphinx/templates/genindex-single.html:5
#, python-format
msgid "Index – %(key)s"
msgstr "Stichwortverzeichnis – %(key)s"
-#: sphinx/templates/genindex-single.html:14
-msgid "Link"
-msgstr "Link"
-
#: sphinx/templates/genindex-single.html:44
#: sphinx/templates/genindex-split.html:14
#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54
@@ -238,7 +491,10 @@ msgid ""
"Note: You requested an out-of-date URL from this server."
" We've tried to redirect you to the new location of this page, but it may"
" not be the right one."
-msgstr "Anmerkung: Du hast eine nicht länger gültige URL von diesem Server angefragt. Wir haben versucht dich auf die neue Adresse dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein."
+msgstr ""
+"Anmerkung: Du hast eine nicht länger gültige URL von "
+"diesem Server angefragt. Wir haben versucht dich auf die neue Adresse "
+"dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein."
#: sphinx/templates/search.html:7
msgid ""
@@ -246,7 +502,12 @@ msgid ""
" words into the box below and click \"search\". Note that the search\n"
" function will automatically search for all of the words. Pages\n"
" containing less words won't appear in the result list."
-msgstr "Von hier aus kannst du die Dokumentation durchsuchen. Gib deine Suchbegriffe in das untenstehende Feld ein und klicke auf \"suchen\". Bitte beachte, dass die Suchfunktion automatisch nach all diesen Worten suchen wird. Seiten, die nicht alle Worte enthalten, werden nicht in der Ergebnisliste erscheinen."
+msgstr ""
+"Von hier aus kannst du die Dokumentation durchsuchen. Gib deine "
+"Suchbegriffe in das untenstehende Feld ein und klicke auf \"suchen\". "
+"Bitte beachte, dass die Suchfunktion automatisch nach all diesen Worten "
+"suchen wird. Seiten, die nicht alle Worte enthalten, werden nicht in der "
+"Ergebnisliste erscheinen."
#: sphinx/templates/search.html:14
msgid "search"
@@ -287,3 +548,4 @@ msgstr "C API-Änderungen"
#: sphinx/templates/changes/versionchanges.html:25
msgid "Other changes"
msgstr "Andere Änderungen"
+
diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot
index 65cc1a645..097e5dc9e 100644
--- a/sphinx/locale/sphinx.pot
+++ b/sphinx/locale/sphinx.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2008-08-08 12:39+0000\n"
+"POT-Creation-Date: 2008-08-10 11:43+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -17,41 +17,306 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.3\n"
-#: sphinx/builder.py:390
+#: sphinx/builder.py:391
#, python-format
msgid "%b %d, %Y"
msgstr ""
-#: sphinx/builder.py:409 sphinx/templates/defindex.html:21
+#: sphinx/builder.py:410 sphinx/templates/defindex.html:21
msgid "General Index"
msgstr ""
-#: sphinx/builder.py:409
+#: sphinx/builder.py:410
msgid "index"
msgstr ""
-#: sphinx/builder.py:411 sphinx/templates/defindex.html:19
-#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:12
+#: sphinx/builder.py:412 sphinx/htmlhelp.py:155
+#: sphinx/templates/defindex.html:19 sphinx/templates/modindex.html:2
+#: sphinx/templates/modindex.html:12
msgid "Global Module Index"
msgstr ""
-#: sphinx/builder.py:411
+#: sphinx/builder.py:412
msgid "modules"
msgstr ""
-#: sphinx/builder.py:447
+#: sphinx/builder.py:448
msgid "next"
msgstr ""
-#: sphinx/builder.py:454
+#: sphinx/builder.py:455
msgid "previous"
msgstr ""
-#: sphinx/environment.py:108 sphinx/latexwriter.py:110
+#: sphinx/builder.py:1089
+msgid "Builtins"
+msgstr ""
+
+#: sphinx/builder.py:1091
+msgid "Module level"
+msgstr ""
+
+#: sphinx/environment.py:108 sphinx/latexwriter.py:114
#, python-format
msgid "%B %d, %Y"
msgstr ""
+#: sphinx/htmlwriter.py:73
+msgid "Permalink to this definition"
+msgstr ""
+
+#: sphinx/htmlwriter.py:379
+msgid "Permalink to this headline"
+msgstr ""
+
+#: sphinx/latexwriter.py:128
+msgid "Release"
+msgstr ""
+
+#: sphinx/latexwriter.py:171
+msgid "Module index"
+msgstr ""
+
+#: sphinx/latexwriter.py:173 sphinx/templates/genindex-single.html:2
+#: sphinx/templates/genindex-split.html:2
+#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2
+#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48
+msgid "Index"
+msgstr ""
+
+#: sphinx/roles.py:52 sphinx/roles.py:55 sphinx/directives/desc.py:519
+#, python-format
+msgid "environment variable; %s"
+msgstr ""
+
+#: sphinx/roles.py:61 sphinx/roles.py:64
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr ""
+
+#: sphinx/textwriter.py:151
+#, python-format
+msgid "Platform: %s"
+msgstr ""
+
+#: sphinx/textwriter.py:353
+msgid "[image]"
+msgstr ""
+
+#: sphinx/directives/desc.py:26
+#, python-format
+msgid "%s() (built-in function)"
+msgstr ""
+
+#: sphinx/directives/desc.py:27 sphinx/directives/desc.py:41
+#: sphinx/directives/desc.py:53
+#, python-format
+msgid "%s() (in module %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:30
+#, python-format
+msgid "%s (built-in variable)"
+msgstr ""
+
+#: sphinx/directives/desc.py:31 sphinx/directives/desc.py:65
+#, python-format
+msgid "%s (in module %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:33
+#, python-format
+msgid "%s (class in %s)"
+msgstr ""
+
+#: sphinx/directives/desc.py:45
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:47
+#, python-format
+msgid "%s() (%s method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:57
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:59
+#, python-format
+msgid "%s() (%s static method)"
+msgstr ""
+
+#: sphinx/directives/desc.py:69
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr ""
+
+#: sphinx/directives/desc.py:71
+#, python-format
+msgid "%s (%s attribute)"
+msgstr ""
+
+#: sphinx/directives/desc.py:73
+#, python-format
+msgid "%s (C function)"
+msgstr ""
+
+#: sphinx/directives/desc.py:75
+#, python-format
+msgid "%s (C member)"
+msgstr ""
+
+#: sphinx/directives/desc.py:77
+#, python-format
+msgid "%s (C macro)"
+msgstr ""
+
+#: sphinx/directives/desc.py:79
+#, python-format
+msgid "%s (C type)"
+msgstr ""
+
+#: sphinx/directives/desc.py:81
+#, python-format
+msgid "%s (C variable)"
+msgstr ""
+
+#: sphinx/directives/desc.py:99
+msgid "Raises"
+msgstr ""
+
+#: sphinx/directives/desc.py:103
+msgid "Variable"
+msgstr ""
+
+#: sphinx/directives/desc.py:106
+msgid "Returns"
+msgstr ""
+
+#: sphinx/directives/desc.py:113
+msgid "Return type"
+msgstr ""
+
+#: sphinx/directives/desc.py:140
+msgid "Parameters"
+msgstr ""
+
+#: sphinx/directives/desc.py:402 sphinx/directives/desc.py:404
+#, python-format
+msgid "command line option; %s"
+msgstr ""
+
+#: sphinx/directives/other.py:102
+msgid "Platforms: "
+msgstr ""
+
+#: sphinx/directives/other.py:107
+#, python-format
+msgid "%s (module)"
+msgstr ""
+
+#: sphinx/directives/other.py:148
+msgid "Section author: "
+msgstr ""
+
+#: sphinx/directives/other.py:150
+msgid "Module author: "
+msgstr ""
+
+#: sphinx/directives/other.py:152
+msgid "Author: "
+msgstr ""
+
+#: sphinx/directives/other.py:238
+msgid "See also"
+msgstr ""
+
+#: sphinx/locale/__init__.py:15
+msgid "Attention"
+msgstr ""
+
+#: sphinx/locale/__init__.py:16
+msgid "Caution"
+msgstr ""
+
+#: sphinx/locale/__init__.py:17
+msgid "Danger"
+msgstr ""
+
+#: sphinx/locale/__init__.py:18
+msgid "Error"
+msgstr ""
+
+#: sphinx/locale/__init__.py:19
+msgid "Hint"
+msgstr ""
+
+#: sphinx/locale/__init__.py:20
+msgid "Important"
+msgstr ""
+
+#: sphinx/locale/__init__.py:21
+msgid "Note"
+msgstr ""
+
+#: sphinx/locale/__init__.py:22
+msgid "See Also"
+msgstr ""
+
+#: sphinx/locale/__init__.py:23
+msgid "Tip"
+msgstr ""
+
+#: sphinx/locale/__init__.py:24
+msgid "Warning"
+msgstr ""
+
+#: sphinx/locale/__init__.py:28
+#, python-format
+msgid "New in version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:29
+#, python-format
+msgid "Changed in version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:30
+#, python-format
+msgid "Deprecated since version %s"
+msgstr ""
+
+#: sphinx/locale/__init__.py:34
+msgid "module"
+msgstr ""
+
+#: sphinx/locale/__init__.py:35
+msgid "keyword"
+msgstr ""
+
+#: sphinx/locale/__init__.py:36
+msgid "operator"
+msgstr ""
+
+#: sphinx/locale/__init__.py:37
+msgid "object"
+msgstr ""
+
+#: sphinx/locale/__init__.py:38
+msgid "exception"
+msgstr ""
+
+#: sphinx/locale/__init__.py:39
+msgid "statement"
+msgstr ""
+
+#: sphinx/locale/__init__.py:40
+msgid "built-in function"
+msgstr ""
+
#: sphinx/templates/defindex.html:2
msgid "Overview"
msgstr ""
@@ -84,22 +349,11 @@ msgstr ""
msgid "all functions, classes, terms"
msgstr ""
-#: sphinx/templates/genindex-single.html:2
-#: sphinx/templates/genindex-split.html:2
-#: sphinx/templates/genindex-split.html:5 sphinx/templates/genindex.html:2
-#: sphinx/templates/genindex.html:5 sphinx/templates/genindex.html:48
-msgid "Index"
-msgstr ""
-
#: sphinx/templates/genindex-single.html:5
#, python-format
msgid "Index – %(key)s"
msgstr ""
-#: sphinx/templates/genindex-single.html:14
-msgid "Link"
-msgstr ""
-
#: sphinx/templates/genindex-single.html:44
#: sphinx/templates/genindex-split.html:14
#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 2cfca3d8b..dcdaf9687 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -49,18 +49,19 @@ def indexmarkup_role(typ, rawtext, etext, lineno, inliner, options={}, content=[
inliner.document.note_explicit_target(targetnode)
if typ == 'envvar':
env.note_index_entry('single', text, targetid, text)
- env.note_index_entry('single', 'environment variable; %s' % text,
+ env.note_index_entry('single', _('environment variable; %s') % text,
targetid, text)
indexnode['entries'] = [('single', text, targetid, text),
- ('single', 'environment variable; %s' % text,
+ ('single', _('environment variable; %s') % text,
targetid, text)]
xref_nodes = xfileref_role(typ, rawtext, etext, lineno, inliner,
options, content)[0]
return [indexnode, targetnode] + xref_nodes, []
elif typ == 'pep':
- env.note_index_entry('single', 'Python Enhancement Proposals!PEP %s' % text,
+ env.note_index_entry('single', _('Python Enhancement Proposals!PEP %s') % text,
targetid, 'PEP %s' % text)
- indexnode['entries'] = [('single', 'Python Enhancement Proposals!PEP %s' % text,
+ indexnode['entries'] = [('single',
+ _('Python Enhancement Proposals!PEP %s') % text,
targetid, 'PEP %s' % text)]
try:
pepnum = int(text)
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 9c728b015..5eff6f8d5 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -198,15 +198,8 @@
}
-% Lots of index-entry generation support.
+% Index-entry generation support.
%
-% Command to wrap around stuff that refers to function / module /
-% attribute names in the index. Default behavior: like \code{}. To
-% just keep the index entries in the roman font, uncomment the second
-% definition; it matches O'Reilly style more.
-%
-\newcommand{\py@idxcode}[1]{\texttt{#1}}
-%\renewcommand{\py@idxcode}[1]{#1}
% Command to generate two index entries (using subentries)
\newcommand{\indexii}[2]{\index{#1!#2}\index{#2!#1}}
@@ -222,23 +215,6 @@
\index{#4!#1 #2 #3}
}
-% Command to generate a reference to a function, statement, keyword,
-% operator.
-\newcommand{\kwindex}[1]{\indexii{keyword}{#1@{\py@idxcode{#1}}}}
-\newcommand{\stindex}[1]{\indexii{statement}{#1@{\py@idxcode{#1}}}}
-\newcommand{\opindex}[1]{\indexii{operator}{#1@{\py@idxcode{#1}}}}
-\newcommand{\exindex}[1]{\indexii{exception}{#1@{\py@idxcode{#1}}}}
-\newcommand{\obindex}[1]{\indexii{object}{#1}}
-\newcommand{\bifuncindex}[1]{%
- \index{#1@{\py@idxcode{#1()}} (built-in function)}}
-
-% Add an index entry for a module
-\newcommand{\py@refmodule}[2]{\index{#1@{\py@idxcode{#1}} (#2module)}}
-\newcommand{\refmodindex}[1]{\py@refmodule{#1}{}}
-\newcommand{\refbimodindex}[1]{\py@refmodule{#1}{built-in }}
-\newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }}
-\newcommand{\refstmodindex}[1]{\py@refmodule{#1}{standard }}
-
% support for the module index
\newif\ifpy@UseModuleIndex
\py@UseModuleIndexfalse
@@ -256,7 +232,6 @@
% Add the defining entry for a module
\newcommand{\py@modindex}[2]{%
\renewcommand{\py@thismodule}{#1}
- \index{#1@{\py@idxcode{#1}} (#2module)}%
\ifpy@UseModuleIndex%
\@ifundefined{py@modplat@\py@thismodulekey}{
\write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}|hyperpage}{\thepage}}%
@@ -273,12 +248,6 @@
\newcommand{\py@thismoduletype}{}
\newcommand{\py@emptymodule}{}
-% Module index types
-\newcommand{\py@standardIndexModule}[1]{\py@modindex{#1}{standard }}
-\newcommand{\py@builtinIndexModule}[1]{\py@modindex{#1}{built-in }}
-\newcommand{\py@extensionIndexModule}[1]{\py@modindex{#1}{extension }}
-\newcommand{\py@IndexModule}[1]{\py@modindex{#1}{}}
-
% \declaremodule[key]{type}{name}
\newcommand{\declaremodule}[3][\py@modulebadkey]{
\renewcommand{\py@thismoduletype}{#2}
@@ -287,12 +256,7 @@
\else
\renewcommand{\py@thismodulekey}{#1}
\fi
- \@ifundefined{py@#2IndexModule}{%
- \typeout{*** MACRO declaremodule called with unknown module type: `#2'}
- \py@IndexModule{#3}%
- }{%
- \csname py@#2IndexModule\endcsname{#3}%
- }
+ \py@modindex{#3}{}
%\label{module-\py@thismodulekey}
}
@@ -415,40 +379,30 @@
% tools/anno-api.py; it pulls the value from the refcounts database.
\newcommand{\cfuncline}[3]{
\py@sigline{\code{#1 \bfcode{#2}}}{#3}%
- \index{#2@{\py@idxcode{#2()}}}
}
-\newenvironment{cfuncdesc}[4][\py@badkey]{
+\newenvironment{cfuncdesc}[3]{
\begin{fulllineitems}
- \cfuncline{#2}{#3}{#4}
- \ifx\@undefined#1\relax\else%
- \emph{Return value: \textbf{#1}.}\\
- \fi
+ \cfuncline{#1}{#2}{#3}
}{\end{fulllineitems}}
% C variables ------------------------------------------------------------
% \begin{cvardesc}{type}{name}
\newenvironment{cvardesc}[2]{
\begin{fulllineitems}
- \item[\code{#1 \bfcode{#2}}\index{#2@{\py@idxcode{#2}}}]
+ \item[\code{#1 \bfcode{#2}}]
}{\end{fulllineitems}}
% C data types -----------------------------------------------------------
% \begin{ctypedesc}[index name]{typedef name}
\newenvironment{ctypedesc}[2][\py@badkey]{
\begin{fulllineitems}
- \item[\bfcode{#2}%
- \ifx\@undefined#1\relax%
- \index{#2@{\py@idxcode{#2}} (C type)}
- \else%
- \index{#2@{\py@idxcode{#1}} (C type)}
- \fi]
+ \item[\bfcode{#2}]
}{\end{fulllineitems}}
% C type fields ----------------------------------------------------------
% \begin{cmemberdesc}{container type}{ctype}{membername}
\newcommand{\cmemberline}[3]{
\item[\code{#2 \bfcode{#3}}]
- \index{#3@{\py@idxcode{#3}} (#1 member)}
}
\newenvironment{cmemberdesc}[3]{
\begin{fulllineitems}
@@ -460,18 +414,13 @@
% -- "simple" because it has no args; NOT for constant definitions!
\newenvironment{csimplemacrodesc}[1]{
\begin{fulllineitems}
- \item[\bfcode{#1}\index{#1@{\py@idxcode{#1}} (macro)}]
+ \item[\bfcode{#1}]
}{\end{fulllineitems}}
% simple functions (not methods) -----------------------------------------
% \begin{funcdesc}{name}{args}
\newcommand{\funcline}[2]{%
- \funclineni{#1}{#2}%
- \ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1()}}}%
- \else%
- \index{#1@{\py@idxcode{#1()}} (in module \py@thismodule)}%
- \fi}
+ \funclineni{#1}{#2}}
\newenvironment{funcdesc}[2]{
\begin{fulllineitems}
\funcline{#1}{#2}
@@ -488,12 +437,7 @@
% classes ----------------------------------------------------------------
% \begin{classdesc}{name}{constructor args}
\newcommand{\classline}[2]{
- \py@sigline{\strong{class }\bfcode{#1}}{#2}%
- \ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1}} (class)}%
- \else%
- \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}%
- \fi}
+ \py@sigline{\strong{class }\bfcode{#1}}{#2}}
\newenvironment{classdesc}[2]{
% Using \renewcommand doesn't work for this, for unknown reasons:
\global\def\py@thisclass{#1}
@@ -515,12 +459,7 @@
% Using \renewcommand doesn't work for this, for unknown reasons:
\global\def\py@thisclass{#1}
\begin{fulllineitems}
- \item[\strong{class }\code{\bfcode{#1}}%
- \ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1}} (class)}%
- \else%
- \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}%
- \fi]
+ \item[\strong{class }\code{\bfcode{#1}}]
}{\end{fulllineitems}}
% \begin{excclassdesc}{name}{constructor args}
@@ -530,11 +469,6 @@
\global\def\py@thisclass{#1}
\begin{fulllineitems}
\py@sigline{\strong{exception }\bfcode{#1}}{#2}%
- \ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1}} (exception)}%
- \else%
- \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}%
- \fi
}{\end{fulllineitems}}
% There is no corresponding {excclassdesc*} environment. To describe
@@ -547,11 +481,6 @@
% \begin{methoddesc}[classname]{methodname}{args}
\newcommand{\methodline}[3][\@undefined]{
\methodlineni{#2}{#3}
- \ifx\@undefined#1\relax
- \index{#2@{\py@idxcode{#2()}} (\py@thisclass\ method)}
- \else
- \index{#2@{\py@idxcode{#2()}} (#1 method)}
- \fi
}
\newenvironment{methoddesc}[3][\@undefined]{
\begin{fulllineitems}
@@ -576,11 +505,6 @@
% \begin{staticmethoddesc}[classname]{methodname}{args}
\newcommand{\staticmethodline}[3][\@undefined]{
\staticmethodlineni{#2}{#3}
- \ifx\@undefined#1\relax
- \index{#2@{\py@idxcode{#2()}} (\py@thisclass\ static method)}
- \else
- \index{#2@{\py@idxcode{#2()}} (#1 static method)}
- \fi
}
\newenvironment{staticmethoddesc}[3][\@undefined]{
\begin{fulllineitems}
@@ -606,10 +530,8 @@
\newcommand{\memberline}[2][\py@classbadkey]{%
\ifx\@undefined#1\relax
\memberlineni{#2}
- \index{#2@{\py@idxcode{#2}} (\py@thisclass\ attribute)}
\else
\memberlineni{#2}
- \index{#2@{\py@idxcode{#2}} (#1 attribute)}
\fi
}
\newenvironment{memberdesc}[2][\py@classbadkey]{
@@ -635,22 +557,13 @@
% -- for constructor information, use excclassdesc instead
\newenvironment{excdesc}[1]{
\begin{fulllineitems}
- \item[\strong{exception }\bfcode{#1}%
- \ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1}} (exception)}%
- \else%
- \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}%
- \fi]
+ \item[\strong{exception }\bfcode{#1}]
}{\end{fulllineitems}}
% Module data or constants: ----------------------------------------------
% \begin{datadesc}{name}
\newcommand{\dataline}[1]{%
- \datalineni{#1}\ifx\py@thismodule\py@emptymodule%
- \index{#1@{\py@idxcode{#1}} (data)}%
- \else%
- \index{#1@{\py@idxcode{#1}} (data in \py@thismodule)}%
- \fi}
+ \datalineni{#1}}
\newenvironment{datadesc}[1]{
\begin{fulllineitems}
\dataline{#1}
@@ -722,90 +635,32 @@
}
% Some are quite plain:
-\newcommand{\py@noticelabel@note}{Note:}
\newcommand{\py@noticestart@note}{}
\newcommand{\py@noticeend@note}{}
-\newcommand{\py@noticelabel@hint}{Hint:}
\newcommand{\py@noticestart@hint}{}
\newcommand{\py@noticeend@hint}{}
-\newcommand{\py@noticelabel@important}{Important:}
\newcommand{\py@noticestart@important}{}
\newcommand{\py@noticeend@important}{}
-\newcommand{\py@noticelabel@tip}{Tip:}
\newcommand{\py@noticestart@tip}{}
\newcommand{\py@noticeend@tip}{}
% Others gets more visible distinction:
-\newcommand{\py@noticelabel@warning}{Warning:}
\newcommand{\py@noticestart@warning}{\py@heavybox}
\newcommand{\py@noticeend@warning}{\py@endheavybox}
-\newcommand{\py@noticelabel@caution}{Caution:}
\newcommand{\py@noticestart@caution}{\py@heavybox}
\newcommand{\py@noticeend@caution}{\py@endheavybox}
-\newcommand{\py@noticelabel@attention}{Attention:}
\newcommand{\py@noticestart@attention}{\py@heavybox}
\newcommand{\py@noticeend@attention}{\py@endheavybox}
-\newcommand{\py@noticelabel@danger}{Danger:}
\newcommand{\py@noticestart@danger}{\py@heavybox}
\newcommand{\py@noticeend@danger}{\py@endheavybox}
-\newcommand{\py@noticelabel@error}{Error:}
\newcommand{\py@noticestart@error}{\py@heavybox}
\newcommand{\py@noticeend@error}{\py@endheavybox}
-
-\newenvironment{notice}[1][note]{
+\newenvironment{notice}[2]{
\def\py@noticetype{#1}
\csname py@noticestart@#1\endcsname
- \par\strong{\csname py@noticelabel@#1\endcsname}
+ \par\strong{#2}
}{\csname py@noticeend@\py@noticetype\endcsname}
-\newcommand{\note}[1]{\strong{\py@noticelabel@note} #1}
-\newcommand{\warning}[1]{\strong{\py@noticelabel@warning} #1}
-
-% Deprecation stuff.
-% Should be extended to allow an index / list of deprecated stuff. But
-% there's a lot of stuff that needs to be done to make that automatable.
-%
-% First parameter is the release number that deprecates the feature, the
-% second is the action the should be taken by users of the feature.
-%
-% Example:
-% \deprecated{1.5.1}{Use \method{frobnicate()} instead.}
-%
-\newcommand{\deprecated}[2]{%
- \strong{Deprecated since release #1.} #2\par}
-
-% New stuff.
-% This should be used to mark things which have been added to the
-% development tree but that aren't in the release, but are documented.
-% This allows release of documentation that already includes updated
-% descriptions. Place at end of descriptor environment.
-%
-% Example:
-% \versionadded{1.5.2}
-% \versionchanged[short explanation]{2.0}
-%
-\newcommand{\versionadded}[2][\py@badkey]{%
- \ifx\@undefined#1\relax%
- { New in version #2. }%
- \else%
- { New in version #2:\ #1 }%
- \fi%
-}
-\newcommand{\versionchanged}[2][\py@badkey]{%
- \ifx\@undefined#1\relax%
- { Changed in version #2. }%
- \else%
- { Changed in version #2:\ #1 }%
- \fi%
-}
-
-
-% See-also environment
-\newenvironment{seealso}{
- \par
- \strong{See Also:}
- \par
-}{\par}
% Allow the release number to be specified independently of the
% \date{}. This allows the date to reflect the document's date and
diff --git a/sphinx/textwriter.py b/sphinx/textwriter.py
index 326042307..c0346da0f 100644
--- a/sphinx/textwriter.py
+++ b/sphinx/textwriter.py
@@ -15,6 +15,7 @@ import textwrap
from docutils import nodes, writers
from sphinx import addnodes
+from sphinx.locale import admonitionlabels, versionlabels
class TextWriter(writers.Writer):
@@ -147,7 +148,7 @@ class TextTranslator(nodes.NodeVisitor):
def visit_module(self, node):
if node.has_key('platform'):
self.new_state(0)
- self.add_text('Platform: %s' % node['platform'])
+ self.add_text(_('Platform: %s') % node['platform'])
self.end_state()
raise nodes.SkipNode
@@ -349,7 +350,7 @@ class TextTranslator(nodes.NodeVisitor):
raise nodes.SkipNode
def visit_image(self, node):
- self.add_text('[image]')
+ self.add_text(_('[image]'))
raise nodes.SkipNode
def visit_transition(self, node):
@@ -446,46 +447,38 @@ class TextTranslator(nodes.NodeVisitor):
def depart_admonition(self, node):
self.end_state()
- def _make_visit_admonition(name):
- def visit_admonition(self, node):
- self.new_state(2)
- return visit_admonition
+ def visit_admonition(self, node):
+ self.new_state(2)
def _make_depart_admonition(name):
def depart_admonition(self, node):
- self.end_state(first=name.capitalize() + ': ')
+ self.end_state(first=admonitionlabels[name] + ': ')
return depart_admonition
- visit_attention = _make_visit_admonition('attention')
+ visit_attention = visit_admonition
depart_attention = _make_depart_admonition('attention')
- visit_caution = _make_visit_admonition('caution')
+ visit_caution = visit_admonition
depart_caution = _make_depart_admonition('caution')
- visit_danger = _make_visit_admonition('danger')
+ visit_danger = visit_admonition
depart_danger = _make_depart_admonition('danger')
- visit_error = _make_visit_admonition('error')
+ visit_error = visit_admonition
depart_error = _make_depart_admonition('error')
- visit_hint = _make_visit_admonition('hint')
+ visit_hint = visit_admonition
depart_hint = _make_depart_admonition('hint')
- visit_important = _make_visit_admonition('important')
+ visit_important = visit_admonition
depart_important = _make_depart_admonition('important')
- visit_note = _make_visit_admonition('note')
+ visit_note = visit_admonition
depart_note = _make_depart_admonition('note')
- visit_tip = _make_visit_admonition('tip')
+ visit_tip = visit_admonition
depart_tip = _make_depart_admonition('tip')
- visit_warning = _make_visit_admonition('warning')
+ visit_warning = visit_admonition
depart_warning = _make_depart_admonition('warning')
def visit_versionmodified(self, node):
self.new_state(0)
- if node['type'] == 'versionadded':
- tmpl = 'Added in version %s'
- elif node['type'] == 'versionchanged':
- tmpl = 'Changed in version %s'
- elif node['type'] == 'deprecated':
- tmpl = 'Deprecated in version %s'
if node.children:
- self.add_text(tmpl % node['version'] + ': ')
+ self.add_text(versionlabels[node['type']] % node['version'] + ': ')
else:
- self.add_text(tmpl % node['version'] + '.')
+ self.add_text(versionlabels[node['type']] % node['version'] + '.')
def depart_versionmodified(self, node):
self.end_state()
@@ -606,4 +599,4 @@ class TextTranslator(nodes.NodeVisitor):
raise nodes.SkipNode
def unknown_visit(self, node):
- raise NotImplementedError("Unknown node: " + node.__class__.__name__)
+ raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
diff --git a/sphinx/util/smartypants.py b/sphinx/util/smartypants.py
index 0c5cdabc3..42f20f366 100644
--- a/sphinx/util/smartypants.py
+++ b/sphinx/util/smartypants.py
@@ -189,7 +189,7 @@ def educateQuotes(s):
return s.replace('"', "“")
-def educateQuotesLatex(s):
+def educateQuotesLatex(s, dquotes=("``", "''")):
"""
Parameter: String.
@@ -227,7 +227,7 @@ def educateQuotesLatex(s):
s = s.replace('"', "\x01")
# Finally, replace all helpers with quotes.
- return s.replace("\x01", "``").replace("\x02", "''").\
+ return s.replace("\x01", dquotes[0]).replace("\x02", dquotes[1]).\
replace("\x03", "`").replace("\x04", "'")
diff --git a/tests/test_i18n.py b/tests/test_i18n.py
new file mode 100644
index 000000000..2e214ad87
--- /dev/null
+++ b/tests/test_i18n.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+"""
+ test_i18n
+ ~~~~~~~~~
+
+ Test locale features.
+
+ :copyright: 2008 by Georg Brandl.
+ :license: BSD.
+"""
+
+from util import *
+
+
+@with_testapp(confoverrides={'language': 'de'})
+def test_i18n(app):
+ app.builder.build_all()