[Python-checkins] r65621 - in doctools/trunk: doc/config.rst sphinx/builder.py sphinx/directives/desc.py sphinx/directives/other.py sphinx/environment.py sphinx/htmlhelp.py sphinx/htmlwriter.py sphinx/latexwriter.py sphinx/locale/__init__.py sphinx/locale/cs/LC_MESSAGES/sphinx.mo sphinx/locale/cs/LC_MESSAGES/sphinx.po sphinx/locale/de/LC_MESSAGES/sphinx.mo sphinx/locale/de/LC_MESSAGES/sphinx.po sphinx/locale/sphinx.pot sphinx/roles.py sphinx/texinputs/sphinx.sty sphinx/textwriter.py sphinx/util/smartypants.py tests/test_i18n.py

georg.brandl python-checkins at python.org
Sun Aug 10 12:00:21 CEST 2008


Author: georg.brandl
Date: Sun Aug 10 12:00:20 2008
New Revision: 65621

Log:
* Add more generated text to the automatic translation.
* Remove all locale-dependent text from sphinx.sty, put it into Python files
  to enable message extraction and translation.
* Use babel in the LaTeX output.
* Centralize locations for labels used in every builder.


Added:
   doctools/trunk/sphinx/locale/__init__.py   (contents, props changed)
   doctools/trunk/tests/test_i18n.py   (contents, props changed)
Modified:
   doctools/trunk/doc/config.rst
   doctools/trunk/sphinx/builder.py
   doctools/trunk/sphinx/directives/desc.py
   doctools/trunk/sphinx/directives/other.py
   doctools/trunk/sphinx/environment.py
   doctools/trunk/sphinx/htmlhelp.py
   doctools/trunk/sphinx/htmlwriter.py
   doctools/trunk/sphinx/latexwriter.py
   doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
   doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po
   doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo
   doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po
   doctools/trunk/sphinx/locale/sphinx.pot
   doctools/trunk/sphinx/roles.py
   doctools/trunk/sphinx/texinputs/sphinx.sty
   doctools/trunk/sphinx/textwriter.py
   doctools/trunk/sphinx/util/smartypants.py

Modified: doctools/trunk/doc/config.rst
==============================================================================
--- doctools/trunk/doc/config.rst	(original)
+++ doctools/trunk/doc/config.rst	Sun Aug 10 12:00:20 2008
@@ -99,8 +99,9 @@
 .. 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
 

Modified: doctools/trunk/sphinx/builder.py
==============================================================================
--- doctools/trunk/sphinx/builder.py	(original)
+++ doctools/trunk/sphinx/builder.py	Sun Aug 10 12:00:20 2008
@@ -25,7 +25,7 @@
 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 @@
         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 @@
                 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 = '<b>%s</b>: <i>%s:</i> %s' % (descname, ttext, context)
                 else:

Modified: doctools/trunk/sphinx/directives/desc.py
==============================================================================
--- doctools/trunk/sphinx/directives/desc.py	(original)
+++ doctools/trunk/sphinx/directives/desc.py	Sun Aug 10 12:00:20 2008
@@ -23,14 +23,14 @@
 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 @@
             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 @@
             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 @@
                     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 @@
             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 @@
         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 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 @@
                     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 @@
                     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 @@
                             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 @@
                 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 @@
         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 @@
 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 @@
     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 @@
             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)

Modified: doctools/trunk/sphinx/directives/other.py
==============================================================================
--- doctools/trunk/sphinx/directives/other.py	(original)
+++ doctools/trunk/sphinx/directives/other.py	Sun Aug 10 12:00:20 2008
@@ -16,6 +16,7 @@
 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 @@
     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 @@
     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 @@
 
 # ------ 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 @@
     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 @@
 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 @@
 
 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)

Modified: doctools/trunk/sphinx/environment.py
==============================================================================
--- doctools/trunk/sphinx/environment.py	(original)
+++ doctools/trunk/sphinx/environment.py	Sun Aug 10 12:00:20 2008
@@ -1051,13 +1051,6 @@
                     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)
 

Modified: doctools/trunk/sphinx/htmlhelp.py
==============================================================================
--- doctools/trunk/sphinx/htmlhelp.py	(original)
+++ doctools/trunk/sphinx/htmlhelp.py	Sun Aug 10 12:00:20 2008
@@ -152,7 +152,8 @@
         f.write('<LI> ' + object_sitemap % (builder.config.html_short_title,
                                             'index.html'))
         if builder.config.html_use_modindex:
-            f.write('<LI> ' + object_sitemap % ('Global Module Index', 'modindex.html'))
+            f.write('<LI> ' + object_sitemap % (_('Global Module Index'),
+                                                'modindex.html'))
         # the TOC
         tocdoc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder,
                                                      prune_toctrees=False)

Modified: doctools/trunk/sphinx/htmlwriter.py
==============================================================================
--- doctools/trunk/sphinx/htmlwriter.py	(original)
+++ doctools/trunk/sphinx/htmlwriter.py	Sun Aug 10 12:00:20 2008
@@ -15,6 +15,7 @@
 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 @@
             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 @@
     def depart_desc_signature(self, node):
         if node['ids'] and self.builder.add_definition_links:
             self.body.append(u'<a class="headerlink" href="#%s" ' % node['ids'][0] +
-                             u'title="Permalink to this definition">\u00B6</a>')
+                             u'title="%s">\u00B6</a>' %
+                             _('Permalink to this definition'))
         self.body.append('</dt>\n')
 
     def visit_desc_addname(self, node):
@@ -131,7 +127,7 @@
 
     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 @@
         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 @@
             aname = node.parent['ids'][0]
             # add permalink anchor
             self.body.append(u'<a class="headerlink" href="#%s" ' % aname +
-                             u'title="Permalink to this headline">\u00B6</a>')
+                             u'title="%s">\u00B6</a>' %
+                             _('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):

Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py	(original)
+++ doctools/trunk/sphinx/latexwriter.py	Sun Aug 10 12:00:20 2008
@@ -18,24 +18,35 @@
 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 @@
                         # 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 @@
                '\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 @@
         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 @@
 
     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 @@
     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 @@
     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 @@
             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

Added: doctools/trunk/sphinx/locale/__init__.py
==============================================================================
--- (empty file)
+++ doctools/trunk/sphinx/locale/__init__.py	Sun Aug 10 12:00:20 2008
@@ -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])

Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
==============================================================================
Binary files doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo	(original) and doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.mo	Sun Aug 10 12:00:20 2008 differ

Modified: doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po
==============================================================================
--- doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po	(original)
+++ doctools/trunk/sphinx/locale/cs/LC_MESSAGES/sphinx.po	Sun Aug 10 12:00:20 2008
@@ -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 <EMAIL at ADDRESS>, 2008.
@@ -8,55 +8,317 @@
 "Project-Id-Version: Sphinx 0.5\n"
 "Report-Msgid-Bugs-To: EMAIL at 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 <pavel.kosina at gmail.com>\n"
 "Language-Team: Pavel Kosina <pavel.kosina at gmail.com>\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 @@
 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 &ndash; %(key)s"
 msgstr "Index &ndash; %(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 @@
 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 @@
 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 @@
 
 #: sphinx/templates/layout.html:186
 #, python-format
-msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
-msgstr "vytvořeno pomocí <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"vytvořeno pomocí <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
 
 #: sphinx/templates/modindex.html:14
 msgid "Most popular modules:"
@@ -240,8 +490,14 @@
 msgstr "Prohledat %(docstitle)s"
 
 #: sphinx/templates/page.html:8
-msgid "<strong>Note:</strong> 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 "<strong>Note:</strong> 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 ""
+"<strong>Note:</strong> 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 ""
+"<strong>Note:</strong> 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 ""

Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo
==============================================================================
Binary files. No diff available.

Modified: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po
==============================================================================
--- doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po	(original)
+++ doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po	Sun Aug 10 12:00:20 2008
@@ -1,14 +1,13 @@
 # German translations for Sphinx.
-# Copyright (C) 2008 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# <EMAIL at ADDRESS>, 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 at 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 <zerok at zerokspot.com>\n"
 "Language-Team: de <LL at li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -17,40 +16,305 @@
 "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 @@
 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 &ndash; %(key)s"
 msgstr "Stichwortverzeichnis &ndash; %(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 @@
 "<strong>Note:</strong> 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 "<strong>Anmerkung:</strong> 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 ""
+"<strong>Anmerkung:</strong> 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 @@
 "    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 @@
 #: sphinx/templates/changes/versionchanges.html:25
 msgid "Other changes"
 msgstr "Andere Änderungen"
+

Modified: doctools/trunk/sphinx/locale/sphinx.pot
==============================================================================
--- doctools/trunk/sphinx/locale/sphinx.pot	(original)
+++ doctools/trunk/sphinx/locale/sphinx.pot	Sun Aug 10 12:00:20 2008
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: Sphinx 0.5\n"
 "Report-Msgid-Bugs-To: EMAIL at 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 <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -17,41 +17,306 @@
 "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 @@
 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 &ndash; %(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

Modified: doctools/trunk/sphinx/roles.py
==============================================================================
--- doctools/trunk/sphinx/roles.py	(original)
+++ doctools/trunk/sphinx/roles.py	Sun Aug 10 12:00:20 2008
@@ -49,18 +49,19 @@
     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)

Modified: doctools/trunk/sphinx/texinputs/sphinx.sty
==============================================================================
--- doctools/trunk/sphinx/texinputs/sphinx.sty	(original)
+++ doctools/trunk/sphinx/texinputs/sphinx.sty	Sun Aug 10 12:00:20 2008
@@ -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 at idxcode}[1]{\texttt{#1}}
-%\renewcommand{\py at 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 at idxcode{#1}}}}
-\newcommand{\stindex}[1]{\indexii{statement}{#1@{\py at idxcode{#1}}}}
-\newcommand{\opindex}[1]{\indexii{operator}{#1@{\py at idxcode{#1}}}}
-\newcommand{\exindex}[1]{\indexii{exception}{#1@{\py at idxcode{#1}}}}
-\newcommand{\obindex}[1]{\indexii{object}{#1}}
-\newcommand{\bifuncindex}[1]{%
-  \index{#1@{\py at idxcode{#1()}} (built-in function)}}
-
-% Add an index entry for a module
-\newcommand{\py at refmodule}[2]{\index{#1@{\py at idxcode{#1}} (#2module)}}
-\newcommand{\refmodindex}[1]{\py at refmodule{#1}{}}
-\newcommand{\refbimodindex}[1]{\py at refmodule{#1}{built-in }}
-\newcommand{\refexmodindex}[1]{\py at refmodule{#1}{extension }}
-\newcommand{\refstmodindex}[1]{\py at refmodule{#1}{standard }}
-
 % support for the module index
 \newif\ifpy at UseModuleIndex
 \py at UseModuleIndexfalse
@@ -256,7 +232,6 @@
 % Add the defining entry for a module
 \newcommand{\py at modindex}[2]{%
   \renewcommand{\py at thismodule}{#1}
-  \index{#1@{\py at idxcode{#1}} (#2module)}%
   \ifpy at UseModuleIndex%
     \@ifundefined{py at modplat@\py at thismodulekey}{
       \write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}|hyperpage}{\thepage}}%
@@ -273,12 +248,6 @@
 \newcommand{\py at thismoduletype}{}
 \newcommand{\py at emptymodule}{}
 
-% Module index types
-\newcommand{\py at standardIndexModule}[1]{\py at modindex{#1}{standard }}
-\newcommand{\py at builtinIndexModule}[1]{\py at modindex{#1}{built-in }}
-\newcommand{\py at extensionIndexModule}[1]{\py at modindex{#1}{extension }}
-\newcommand{\py at IndexModule}[1]{\py at modindex{#1}{}}
-
 % \declaremodule[key]{type}{name}
 \newcommand{\declaremodule}[3][\py at modulebadkey]{
   \renewcommand{\py at thismoduletype}{#2}
@@ -287,12 +256,7 @@
   \else
     \renewcommand{\py at thismodulekey}{#1}
   \fi
-  \@ifundefined{py@#2IndexModule}{%
-    \typeout{*** MACRO declaremodule called with unknown module type: `#2'}
-    \py at IndexModule{#3}%
-  }{%
-    \csname py@#2IndexModule\endcsname{#3}%
-  }
+  \py at modindex{#3}{}
   %\label{module-\py at thismodulekey}
 }
 
@@ -415,40 +379,30 @@
 % tools/anno-api.py; it pulls the value from the refcounts database.
 \newcommand{\cfuncline}[3]{
   \py at sigline{\code{#1 \bfcode{#2}}}{#3}%
-  \index{#2@{\py at idxcode{#2()}}}
 }
-\newenvironment{cfuncdesc}[4][\py at 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 at idxcode{#2}}}]
+    \item[\code{#1 \bfcode{#2}}]
 }{\end{fulllineitems}}
 
 % C data types -----------------------------------------------------------
 % \begin{ctypedesc}[index name]{typedef name}
 \newenvironment{ctypedesc}[2][\py at badkey]{
   \begin{fulllineitems}
-    \item[\bfcode{#2}%
-    \ifx\@undefined#1\relax%
-      \index{#2@{\py at idxcode{#2}} (C type)}
-    \else%
-      \index{#2@{\py at 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 at 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 at idxcode{#1}} (macro)}]
+    \item[\bfcode{#1}]
 }{\end{fulllineitems}}
 
 % simple functions (not methods) -----------------------------------------
 % \begin{funcdesc}{name}{args}
 \newcommand{\funcline}[2]{%
-  \funclineni{#1}{#2}%
-  \ifx\py at thismodule\py at emptymodule%
-  \index{#1@{\py at idxcode{#1()}}}%
-  \else%
-  \index{#1@{\py at idxcode{#1()}} (in module \py at 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 at sigline{\strong{class }\bfcode{#1}}{#2}%
-  \ifx\py at thismodule\py at emptymodule%
-  \index{#1@{\py at idxcode{#1}} (class)}%
-  \else%
-  \index{#1@{\py at idxcode{#1}} (class in \py at thismodule)}%
-  \fi}
+  \py at sigline{\strong{class }\bfcode{#1}}{#2}}
 \newenvironment{classdesc}[2]{
   % Using \renewcommand doesn't work for this, for unknown reasons:
   \global\def\py at thisclass{#1}
@@ -515,12 +459,7 @@
   % Using \renewcommand doesn't work for this, for unknown reasons:
   \global\def\py at thisclass{#1}
   \begin{fulllineitems}
-    \item[\strong{class }\code{\bfcode{#1}}%
-      \ifx\py at thismodule\py at emptymodule%
-      \index{#1@{\py at idxcode{#1}} (class)}%
-      \else%
-      \index{#1@{\py at idxcode{#1}} (class in \py at thismodule)}%
-      \fi]
+    \item[\strong{class }\code{\bfcode{#1}}]
 }{\end{fulllineitems}}
 
 % \begin{excclassdesc}{name}{constructor args}
@@ -530,11 +469,6 @@
   \global\def\py at thisclass{#1}
   \begin{fulllineitems}
     \py at sigline{\strong{exception }\bfcode{#1}}{#2}%
-    \ifx\py at thismodule\py at emptymodule%
-    \index{#1@{\py at idxcode{#1}} (exception)}%
-    \else%
-    \index{#1@{\py at idxcode{#1}} (exception in \py at 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 at idxcode{#2()}} (\py at thisclass\ method)}
-  \else
-    \index{#2@{\py at 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 at idxcode{#2()}} (\py at thisclass\ static method)}
-  \else
-    \index{#2@{\py at idxcode{#2()}} (#1 static method)}
-  \fi
 }
 \newenvironment{staticmethoddesc}[3][\@undefined]{
   \begin{fulllineitems}
@@ -606,10 +530,8 @@
 \newcommand{\memberline}[2][\py at classbadkey]{%
   \ifx\@undefined#1\relax
     \memberlineni{#2}
-    \index{#2@{\py at idxcode{#2}} (\py at thisclass\ attribute)}
   \else
     \memberlineni{#2}
-    \index{#2@{\py at idxcode{#2}} (#1 attribute)}
   \fi
 }
 \newenvironment{memberdesc}[2][\py at classbadkey]{
@@ -635,22 +557,13 @@
 %  -- for constructor information, use excclassdesc instead
 \newenvironment{excdesc}[1]{
   \begin{fulllineitems}
-    \item[\strong{exception }\bfcode{#1}%
-          \ifx\py at thismodule\py at emptymodule%
-          \index{#1@{\py at idxcode{#1}} (exception)}%
-          \else%
-          \index{#1@{\py at idxcode{#1}} (exception in \py at thismodule)}%
-          \fi]
+    \item[\strong{exception }\bfcode{#1}]
 }{\end{fulllineitems}}
 
 % Module data or constants: ----------------------------------------------
 % \begin{datadesc}{name}
 \newcommand{\dataline}[1]{%
-  \datalineni{#1}\ifx\py at thismodule\py at emptymodule%
-    \index{#1@{\py at idxcode{#1}} (data)}%
-    \else%
-    \index{#1@{\py at idxcode{#1}} (data in \py at thismodule)}%
-    \fi}
+  \datalineni{#1}}
 \newenvironment{datadesc}[1]{
   \begin{fulllineitems}
     \dataline{#1}
@@ -722,90 +635,32 @@
 }
 
 % Some are quite plain:
-\newcommand{\py at noticelabel@note}{Note:}
 \newcommand{\py at noticestart@note}{}
 \newcommand{\py at noticeend@note}{}
-\newcommand{\py at noticelabel@hint}{Hint:}
 \newcommand{\py at noticestart@hint}{}
 \newcommand{\py at noticeend@hint}{}
-\newcommand{\py at noticelabel@important}{Important:}
 \newcommand{\py at noticestart@important}{}
 \newcommand{\py at noticeend@important}{}
-\newcommand{\py at noticelabel@tip}{Tip:}
 \newcommand{\py at noticestart@tip}{}
 \newcommand{\py at noticeend@tip}{}
 
 % Others gets more visible distinction:
-\newcommand{\py at noticelabel@warning}{Warning:}
 \newcommand{\py at noticestart@warning}{\py at heavybox}
 \newcommand{\py at noticeend@warning}{\py at endheavybox}
-\newcommand{\py at noticelabel@caution}{Caution:}
 \newcommand{\py at noticestart@caution}{\py at heavybox}
 \newcommand{\py at noticeend@caution}{\py at endheavybox}
-\newcommand{\py at noticelabel@attention}{Attention:}
 \newcommand{\py at noticestart@attention}{\py at heavybox}
 \newcommand{\py at noticeend@attention}{\py at endheavybox}
-\newcommand{\py at noticelabel@danger}{Danger:}
 \newcommand{\py at noticestart@danger}{\py at heavybox}
 \newcommand{\py at noticeend@danger}{\py at endheavybox}
-\newcommand{\py at noticelabel@error}{Error:}
 \newcommand{\py at noticestart@error}{\py at heavybox}
 \newcommand{\py at noticeend@error}{\py at endheavybox}
 
-
-\newenvironment{notice}[1][note]{
+\newenvironment{notice}[2]{
   \def\py at noticetype{#1}
   \csname py at noticestart@#1\endcsname
-  \par\strong{\csname py at noticelabel@#1\endcsname}
+  \par\strong{#2}
 }{\csname py at noticeend@\py at noticetype\endcsname}
-\newcommand{\note}[1]{\strong{\py at noticelabel@note} #1}
-\newcommand{\warning}[1]{\strong{\py at 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 at badkey]{%
-  \ifx\@undefined#1\relax%
-    {  New in version #2.  }%
-  \else%
-    {  New in version #2:\ #1  }%
-  \fi%
-}
-\newcommand{\versionchanged}[2][\py at 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

Modified: doctools/trunk/sphinx/textwriter.py
==============================================================================
--- doctools/trunk/sphinx/textwriter.py	(original)
+++ doctools/trunk/sphinx/textwriter.py	Sun Aug 10 12:00:20 2008
@@ -15,6 +15,7 @@
 from docutils import nodes, writers
 
 from sphinx import addnodes
+from sphinx.locale import admonitionlabels, versionlabels
 
 
 class TextWriter(writers.Writer):
@@ -147,7 +148,7 @@
     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 @@
         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 @@
     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 @@
         raise nodes.SkipNode
 
     def unknown_visit(self, node):
-        raise NotImplementedError("Unknown node: " + node.__class__.__name__)
+        raise NotImplementedError('Unknown node: ' + node.__class__.__name__)

Modified: doctools/trunk/sphinx/util/smartypants.py
==============================================================================
--- doctools/trunk/sphinx/util/smartypants.py	(original)
+++ doctools/trunk/sphinx/util/smartypants.py	Sun Aug 10 12:00:20 2008
@@ -189,7 +189,7 @@
     return s.replace('"', "&#8220;")
 
 
-def educateQuotesLatex(s):
+def educateQuotesLatex(s, dquotes=("``", "''")):
     """
     Parameter:  String.
 
@@ -227,7 +227,7 @@
     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", "'")
 
 

Added: doctools/trunk/tests/test_i18n.py
==============================================================================
--- (empty file)
+++ doctools/trunk/tests/test_i18n.py	Sun Aug 10 12:00:20 2008
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+"""
+    test_i18n
+    ~~~~~~~~~
+
+    Test locale features.
+
+    :copyright: 2008 by Georg Brandl.
+    :license: BSD.
+"""
+
+from util import *
+
+
+ at with_testapp(confoverrides={'language': 'de'})
+def test_i18n(app):
+    app.builder.build_all()


More information about the Python-checkins mailing list