[Python-checkins] r65597 - in doctools/trunk: CHANGES babel.cfg doc/conf.py doc/config.rst setup.cfg sphinx/_jinja.py sphinx/builder.py sphinx/config.py sphinx/environment.py sphinx/latexwriter.py sphinx/locale sphinx/locale/de sphinx/locale/de/LC_MESSAGES sphinx/locale/de/LC_MESSAGES/sphinx.mo sphinx/locale/de/LC_MESSAGES/sphinx.po sphinx/locale/sphinx.pot sphinx/quickstart.py sphinx/templates/changes/frameset.html sphinx/templates/changes/rstsource.html sphinx/templates/changes/versionchanges.html sphinx/templates/defindex.html sphinx/templates/genindex-single.html sphinx/templates/genindex-split.html sphinx/templates/genindex.html sphinx/templates/layout.html sphinx/templates/modindex.html sphinx/templates/opensearch.xml sphinx/templates/page.html sphinx/templates/search.html

georg.brandl python-checkins at python.org
Fri Aug 8 12:54:01 CEST 2008


Author: georg.brandl
Date: Fri Aug  8 12:54:00 2008
New Revision: 65597

Log:
Add i18n support, thanks to Horst Gutmann.


Added:
   doctools/trunk/babel.cfg   (contents, props changed)
   doctools/trunk/sphinx/locale/
   doctools/trunk/sphinx/locale/de/
   doctools/trunk/sphinx/locale/de/LC_MESSAGES/
   doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo   (contents, props changed)
   doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po   (contents, props changed)
   doctools/trunk/sphinx/locale/sphinx.pot   (contents, props changed)
Modified:
   doctools/trunk/CHANGES
   doctools/trunk/doc/conf.py
   doctools/trunk/doc/config.rst
   doctools/trunk/setup.cfg
   doctools/trunk/sphinx/_jinja.py
   doctools/trunk/sphinx/builder.py
   doctools/trunk/sphinx/config.py
   doctools/trunk/sphinx/environment.py
   doctools/trunk/sphinx/latexwriter.py
   doctools/trunk/sphinx/quickstart.py
   doctools/trunk/sphinx/templates/changes/frameset.html
   doctools/trunk/sphinx/templates/changes/rstsource.html
   doctools/trunk/sphinx/templates/changes/versionchanges.html
   doctools/trunk/sphinx/templates/defindex.html
   doctools/trunk/sphinx/templates/genindex-single.html
   doctools/trunk/sphinx/templates/genindex-split.html
   doctools/trunk/sphinx/templates/genindex.html
   doctools/trunk/sphinx/templates/layout.html
   doctools/trunk/sphinx/templates/modindex.html
   doctools/trunk/sphinx/templates/opensearch.xml
   doctools/trunk/sphinx/templates/page.html
   doctools/trunk/sphinx/templates/search.html

Modified: doctools/trunk/CHANGES
==============================================================================
--- doctools/trunk/CHANGES	(original)
+++ doctools/trunk/CHANGES	Fri Aug  8 12:54:00 2008
@@ -11,6 +11,10 @@
   creates links to Sphinx documentation of Python objects in other
   projects.
 
+* Added support for internationalization in generated text with the
+  ``language`` and ``locale_dirs`` config values.  Many thanks to
+  Horst Gutmann, who also contributed German as the first language.
+  
 * Added a distutils command `build_sphinx`: When Sphinx is installed,
   you can call ``python setup.py build_sphinx`` for projects that
   have Sphinx documentation, which will build the docs and place them

Added: doctools/trunk/babel.cfg
==============================================================================
--- (empty file)
+++ doctools/trunk/babel.cfg	Fri Aug  8 12:54:00 2008
@@ -0,0 +1,5 @@
+[extractors]
+jinja = sphinx._jinja.babel_extract
+[python: **.py]
+[jinja: **/templates/**.html]
+[jinja: **/templates/**.xml]

Modified: doctools/trunk/doc/conf.py
==============================================================================
--- doctools/trunk/doc/conf.py	(original)
+++ doctools/trunk/doc/conf.py	Fri Aug  8 12:54:00 2008
@@ -19,6 +19,8 @@
 # General configuration
 # ---------------------
 
+language = 'de'
+
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.addons.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
@@ -49,7 +51,7 @@
 # non-false value, then it is used:
 #today = ''
 # Else, today_fmt is used as the format for a strftime call.
-today_fmt = '%B %d, %Y'
+#today_fmt = '%B %d, %Y'
 
 # List of documents that shouldn't be included in the build.
 #unused_docs = []

Modified: doctools/trunk/doc/config.rst
==============================================================================
--- doctools/trunk/doc/config.rst	(original)
+++ doctools/trunk/doc/config.rst	Fri Aug  8 12:54:00 2008
@@ -96,6 +96,31 @@
    If you don't need the separation provided between :confval:`version` and
    :confval:`release`, just set them both to the same value.
 
+.. 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.
+
+   .. versionadded:: 0.5
+
+   Currently supported languages are:
+
+   * ``en`` -- English
+   * ``de`` -- German
+
+.. confval:: locale_dirs
+
+   .. versionadded:: 0.5
+
+   Additional directories to search for Sphinx message catalogs, relative to the
+   source directory.  The directories on this path are searched by the standard
+   :mod:`gettext` module for a domain of ``sphinx``; so if you add the directory
+   :file:`./locale` to this settting, the message catalogs must be in
+   :file:`./locale/{language}/LC_MESSAGES/sphinx.mo`.
+
+   The default is ``[]``.
+   
 .. confval:: today
              today_fmt
 
@@ -107,7 +132,8 @@
      the format given in :confval:`today_fmt`.
 
    The default is no :confval:`today` and a :confval:`today_fmt` of ``'%B %d,
-   %Y'``.
+   %Y'`` (or, if translation is enabled with :confval:`language`, am equivalent
+   %format for the selected locale).
 
 .. confval:: unused_docs
 
@@ -164,7 +190,7 @@
    standard reST :dir:`default-role` directive.
 
    .. versionadded:: 0.4
-   
+
 .. confval:: add_function_parentheses
 
    A boolean that decides whether parentheses are appended to function and
@@ -247,7 +273,7 @@
 
    If this is not the empty string, a 'Last updated on:' timestamp is inserted
    at every page bottom, using the given :func:`strftime` format.  Default is
-   ``'%b %d, %Y'``.
+   ``'%b %d, %Y'`` (or a locale-dependent equivalent).
 
 .. confval:: html_use_smartypants
 
@@ -309,7 +335,7 @@
    entries, and once as one page per starting letter.  Default is ``False``.
 
    .. versionadded:: 0.4
-   
+
 .. confval:: html_copy_source
 
    If true, the reST sources are included in the HTML build as

Modified: doctools/trunk/setup.cfg
==============================================================================
--- doctools/trunk/setup.cfg	(original)
+++ doctools/trunk/setup.cfg	Fri Aug  8 12:54:00 2008
@@ -5,3 +5,15 @@
 [aliases]
 release = egg_info -RDb ''
 
+[extract_messages]
+mapping_file = babel.cfg
+output_file = sphinx/locale/sphinx.pot
+
+[update_catalog]
+input_file = sphinx/locale/sphinx.pot
+domain = sphinx
+output_dir = sphinx/locale/
+
+[compile_catalog]
+domain = sphinx
+directory = sphinx/locale/

Modified: doctools/trunk/sphinx/_jinja.py
==============================================================================
--- doctools/trunk/sphinx/_jinja.py	(original)
+++ doctools/trunk/sphinx/_jinja.py	Fri Aug  8 12:54:00 2008
@@ -5,7 +5,7 @@
 
     Jinja glue.
 
-    :copyright: 2007-2008 by Georg Brandl.
+    :copyright: 2007-2008 by Georg Brandl, Horst Gutmann.
     :license: BSD.
 """
 
@@ -19,6 +19,16 @@
 from jinja.loaders import BaseLoader
 from jinja.exceptions import TemplateNotFound
 
+
+def babel_extract(fileobj, keywords, comment_tags, options):
+    """
+    Simple extractor to get some basic Babel support.
+    """
+    env = Environment()
+    for lineno, sg, pl in env.get_translations_for_string(fileobj.read()):
+        yield lineno, None, (sg, pl), ''
+
+
 class SphinxFileSystemLoader(BaseLoader):
     """
     A loader that loads templates either relative to one of a list of given
@@ -55,6 +65,26 @@
             f.close()
 
 
+class TranslatorEnvironment(Environment):
+    class _Translator(object):
+        def __init__(self, translator):
+            self.trans = translator
+
+        def gettext(self, string):
+            return self.trans.gettext(string)
+
+        def ngettext(self, singular, plural, n):
+            return senf.trans.ngettext(singular, plural, n)
+
+    def __init__(self, *args, **kwargs):
+        self.translator = kwargs['translator']
+        del kwargs['translator']
+        super(TranslatorEnvironment, self).__init__(*args, **kwargs)
+
+    def get_translator(self, context):
+        return TranslatorEnvironment._Translator(self.translator)
+
+
 class BuiltinTemplates(TemplateBridge):
     def init(self, builder):
         self.templates = {}
@@ -63,10 +93,14 @@
                               for dir in builder.config.templates_path]
         self.templates_path = [base_templates_path] + ext_templates_path
         loader = SphinxFileSystemLoader(base_templates_path, ext_templates_path)
-        self.jinja_env = Environment(loader=loader,
-                                     # disable traceback, more likely that something
-                                     # in the application is broken than in the templates
-                                     friendly_traceback=False)
+        if builder.translator is not None:
+            self.jinja_env = TranslatorEnvironment(loader=loader,
+                    friendly_traceback=False, translator=builder.translator)
+        else:
+            self.jinja_env = Environment(loader=loader,
+                    # disable traceback, more likely that something
+                    # in the application is broken than in the templates
+                    friendly_traceback=False)
 
     def newest_template_mtime(self):
         return max(mtimes_of_files(self.templates_path, '.html'))

Modified: doctools/trunk/sphinx/builder.py
==============================================================================
--- doctools/trunk/sphinx/builder.py	(original)
+++ doctools/trunk/sphinx/builder.py	Fri Aug  8 12:54:00 2008
@@ -5,7 +5,7 @@
 
     Builder classes for different output formats.
 
-    :copyright: 2007-2008 by Georg Brandl, Sebastian Wiesner.
+    :copyright: 2007-2008 by Georg Brandl, Sebastian Wiesner, Horst Gutmann.
     :license: BSD.
 """
 
@@ -13,6 +13,7 @@
 import time
 import codecs
 import shutil
+import gettext
 import cPickle as pickle
 from os import path
 from cgi import escape
@@ -64,6 +65,8 @@
         self.info = app.info
         self.config = app.config
 
+        self.load_i18n()
+
         # images that need to be copied over (source -> dest)
         self.images = {}
 
@@ -152,6 +155,36 @@
 
     # build methods
 
+    def load_i18n(self):
+        """
+        Load translated strings from the configured localedirs if
+        enabled in the configuration.
+        """
+        self.translator = None
+        if self.config.language is not None:
+            self.info(bold('loading translations [%s]... ' % self.config.language),
+                      nonl=True)
+            locale_dirs = [path.join(path.dirname(__file__), 'locale')] + \
+                          [path.join(self.srcdir, x) for x in self.config.locale_dirs]
+            for dir_ in locale_dirs:
+                try:
+                    trans = gettext.translation('sphinx', localedir=dir_,
+                            languages=[self.config.language])
+                    if self.translator is None:
+                        self.translator = trans
+                    else:
+                        self.translator._catalog.update(trans.catalog)
+                except Exception:
+                    # Language couldn't be found in the specified path
+                    pass
+            if self.translator is not None:
+                self.info('ok')
+            else:
+                self.info('selected locale not available' % self.config.language)
+        if self.translator is None:
+            self.translator = gettext.NullTranslations()
+        self.translator.install()
+
     def load_env(self):
         """Set up the build environment."""
         if self.env:
@@ -353,8 +386,8 @@
         # format the "last updated on" string, only once is enough since it
         # typically doesn't include the time of day
         lufmt = self.config.html_last_updated_fmt
-        if lufmt:
-            self.last_updated = time.strftime(lufmt)
+        if lufmt is not None:
+            self.last_updated = time.strftime(lufmt or _('%b %d, %Y'))
         else:
             self.last_updated = None
 
@@ -373,9 +406,9 @@
 
         rellinks = []
         if self.config.html_use_index:
-            rellinks.append(('genindex', 'General Index', 'I', 'index'))
+            rellinks.append(('genindex', _('General Index'), 'I', _('index')))
         if self.config.html_use_modindex:
-            rellinks.append(('modindex', 'Global Module Index', 'M', 'modules'))
+            rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules')))
 
         self.globalcontext = dict(
             project = self.config.project,
@@ -411,14 +444,14 @@
             try:
                 next = {'link': self.get_relative_uri(docname, related[2]),
                         'title': self.render_partial(titles[related[2]])['title']}
-                rellinks.append((related[2], next['title'], 'N', 'next'))
+                rellinks.append((related[2], next['title'], 'N', _('next')))
             except KeyError:
                 next = None
         if related and related[1]:
             try:
                 prev = {'link': self.get_relative_uri(docname, related[1]),
                         'title': self.render_partial(titles[related[1]])['title']}
-                rellinks.append((related[1], prev['title'], 'P', 'previous'))
+                rellinks.append((related[1], prev['title'], 'P', _('previous')))
             except KeyError:
                 # the relation is (somehow) not in the TOC tree, handle that gracefully
                 prev = None

Modified: doctools/trunk/sphinx/config.py
==============================================================================
--- doctools/trunk/sphinx/config.py	(original)
+++ doctools/trunk/sphinx/config.py	Fri Aug  8 12:54:00 2008
@@ -22,15 +22,17 @@
     # quickstart.py file template as well as in the docs!
 
     config_values = dict(
-        # general substitutions
+        # general options
         project = ('Python', True),
         copyright = ('', False),
         version = ('', True),
         release = ('', True),
         today = ('', True),
-        today_fmt = ('%B %d, %Y', True),
+        today_fmt = (None, True),  # the real default is locale-dependent
+
+        language = ('en', True),
+        locale_dirs = ([], True),
 
-        # general options
         master_doc = ('contents', True),
         source_suffix = ('.rst', True),
         unused_docs = ([], True),
@@ -53,7 +55,7 @@
         html_logo = (None, False),
         html_favicon = (None, False),
         html_static_path = ([], False),
-        html_last_updated_fmt = ('%b %d, %Y', False),
+        html_last_updated_fmt = (None, False),  # the real default is locale-dependent
         html_use_smartypants = (True, False),
         html_translator_class = (None, False),
         html_sidebars = ({}, False),

Modified: doctools/trunk/sphinx/environment.py
==============================================================================
--- doctools/trunk/sphinx/environment.py	(original)
+++ doctools/trunk/sphinx/environment.py	Fri Aug  8 12:54:00 2008
@@ -105,7 +105,7 @@
                 text = config[refname]
                 if refname == 'today' and not text:
                     # special handling: can also specify a strftime format
-                    text = time.strftime(config.today_fmt)
+                    text = time.strftime(config.today_fmt or _('%B %d, %Y'))
                 ref.replace_self(nodes.Text(text, text))
 
 

Modified: doctools/trunk/sphinx/latexwriter.py
==============================================================================
--- doctools/trunk/sphinx/latexwriter.py	(original)
+++ doctools/trunk/sphinx/latexwriter.py	Fri Aug  8 12:54:00 2008
@@ -107,7 +107,7 @@
         paper = builder.config.latex_paper_size + 'paper'
         if paper == 'paper': # e.g. command line "-D latex_paper_size="
             paper = 'letterpaper'
-        date = time.strftime(builder.config.today_fmt)
+        date = time.strftime(builder.config.today_fmt or _('%B %d, %Y'))
         logo = (builder.config.latex_logo and
                 "\\includegraphics{%s}\\par" % path.basename(builder.config.latex_logo)
                 or '')

Added: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.mo
==============================================================================
Binary file. No diff available.

Added: doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po
==============================================================================
--- (empty file)
+++ doctools/trunk/sphinx/locale/de/LC_MESSAGES/sphinx.po	Fri Aug  8 12:54:00 2008
@@ -0,0 +1,289 @@
+# German translations for Sphinx.
+# Copyright (C) 2008 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# <EMAIL at ADDRESS>, 2008.
+#
+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"
+"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"
+"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"
+
+#: sphinx/builder.py:390
+#, fuzzy, python-format
+msgid "%b %d, %Y"
+msgstr "%d.%b.%Y"
+
+#: sphinx/builder.py:409 sphinx/templates/defindex.html:21
+msgid "General Index"
+msgstr "Allgemeiner Index"
+
+#: sphinx/builder.py:409
+msgid "index"
+msgstr "Index"
+
+#: sphinx/builder.py:411 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
+msgid "modules"
+msgstr "Module"
+
+#: sphinx/builder.py:447
+msgid "next"
+msgstr "weiter"
+
+#: sphinx/builder.py:454
+msgid "previous"
+msgstr "zurück"
+
+#: sphinx/environment.py:108 sphinx/latexwriter.py:110
+#, python-format
+msgid "%B %d, %Y"
+msgstr "%d.%b.%Y"
+
+#: sphinx/templates/defindex.html:2
+msgid "Overview"
+msgstr "Übersicht"
+
+#: sphinx/templates/defindex.html:11
+msgid "Indices and tables:"
+msgstr "Indizes und Tabellen:"
+
+#: sphinx/templates/defindex.html:14
+msgid "Complete Table of Contents"
+msgstr "Vollständiges Inhaltsverzeichnis"
+
+#: sphinx/templates/defindex.html:15
+msgid "lists all sections and subsections"
+msgstr "Liste aller Kapitel und Unterkapitel"
+
+#: sphinx/templates/defindex.html:16
+msgid "Search page"
+msgstr "Suche"
+
+#: sphinx/templates/defindex.html:17
+msgid "search this documentation"
+msgstr "Durchsuche diese Dokumentation"
+
+#: sphinx/templates/defindex.html:20
+msgid "quick access to all modules"
+msgstr "Schneller Zugriff auf alle Module"
+
+#: sphinx/templates/defindex.html:22
+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
+msgid "Full index on one page"
+msgstr "Gesamtes Stichwortverzeichnis auf einer Seite"
+
+#: sphinx/templates/genindex-split.html:7
+msgid "Index pages by letter"
+msgstr "Stichwortverzeichnis nach Anfangsbuchstabe"
+
+#: sphinx/templates/genindex-split.html:15
+msgid "can be huge"
+msgstr "kann groß sein"
+
+#: sphinx/templates/layout.html:9
+msgid "Navigation"
+msgstr "Navigation"
+
+#: sphinx/templates/layout.html:40
+msgid "Table Of Contents"
+msgstr "Inhalt"
+
+#: sphinx/templates/layout.html:46
+msgid "Previous topic"
+msgstr "Vorheriges Thema"
+
+#: sphinx/templates/layout.html:47
+msgid "previous chapter"
+msgstr "vorheriges Kapitel"
+
+#: sphinx/templates/layout.html:50
+msgid "Next topic"
+msgstr "Nächstes Thema"
+
+#: sphinx/templates/layout.html:51
+msgid "next chapter"
+msgstr "nächstes Kapitel"
+
+#: sphinx/templates/layout.html:55
+msgid "This Page"
+msgstr "Diese Seite"
+
+#: sphinx/templates/layout.html:59
+msgid "Suggest Change"
+msgstr "Änderung vorschlagen"
+
+#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62
+msgid "Show Source"
+msgstr "Quelltext anzeigen"
+
+#: sphinx/templates/layout.html:71
+msgid "Quick search"
+msgstr "Schnellsuche"
+
+#: sphinx/templates/layout.html:71
+msgid "Keyword search"
+msgstr "Stichwortsuche"
+
+#: sphinx/templates/layout.html:73
+msgid "Go"
+msgstr "Los"
+
+#: sphinx/templates/layout.html:78
+msgid "Enter a module, class or function name."
+msgstr "Gib einen Modul-, Klassen- oder Funktionsnamen an."
+
+#: sphinx/templates/layout.html:118
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "Suche in %(docstitle)s"
+
+#: sphinx/templates/layout.html:127
+msgid "About these documents"
+msgstr "Über diese Dokumentation"
+
+#: sphinx/templates/layout.html:129
+msgid "Global table of contents"
+msgstr "Globales Inhaltsverzeichnis"
+
+#: sphinx/templates/layout.html:130
+msgid "Global index"
+msgstr "Globale Stichwortverzeichnis"
+
+#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2
+#: sphinx/templates/search.html:5
+msgid "Search"
+msgstr "Suche"
+
+#: sphinx/templates/layout.html:133
+msgid "Copyright"
+msgstr "Copyright"
+
+#: sphinx/templates/layout.html:178
+#, python-format
+msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+msgstr "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+
+#: sphinx/templates/layout.html:180
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; Copyright %(copyright)s."
+
+#: sphinx/templates/layout.html:183
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "Zuletzt aktualisiert am %(last_updated)s."
+
+#: sphinx/templates/layout.html:186
+#, python-format
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+"Mit <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s "
+"erstellt."
+
+#: sphinx/templates/modindex.html:14
+msgid "Most popular modules:"
+msgstr "Beliebteste Module:"
+
+#: sphinx/templates/modindex.html:23
+msgid "Show modules only available on these platforms"
+msgstr "Zeige nur Module, die auf diesen Plattformen verfügbar sind"
+
+#: sphinx/templates/modindex.html:55
+msgid "Deprecated"
+msgstr "Veraltet"
+
+#: sphinx/templates/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "Suche in %(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>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 ""
+"From here you can search these documents. Enter your search\n"
+"    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."
+
+#: sphinx/templates/search.html:14
+msgid "search"
+msgstr "suchen"
+
+#: sphinx/templates/search.html:18
+msgid "Search Results"
+msgstr "Suchergebnisse"
+
+#: sphinx/templates/search.html:20
+msgid "Your search did not match any results."
+msgstr "Deine Suche ergab leider keine Treffer."
+
+#: sphinx/templates/changes/frameset.html:5
+#: sphinx/templates/changes/versionchanges.html:12
+#, python-format
+msgid "Changes in Version %(version)s &mdash; %(docstitle)s"
+msgstr "Änderungen in Version %(version)s &mdash; %(docstitle)s"
+
+#: sphinx/templates/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr "%(filename)s &mdash; %(docstitle)s"
+
+#: sphinx/templates/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr "Automatisch generierte Liste der Änderungen in Version %(version)s"
+
+#: sphinx/templates/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "Bibliotheksänderungen"
+
+#: sphinx/templates/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "C API-Änderungen"
+
+#: sphinx/templates/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "Andere Änderungen"

Added: doctools/trunk/sphinx/locale/sphinx.pot
==============================================================================
--- (empty file)
+++ doctools/trunk/sphinx/locale/sphinx.pot	Fri Aug  8 12:54:00 2008
@@ -0,0 +1,288 @@
+# Translations template for Sphinx.
+# Copyright (C) 2008 ORGANIZATION
+# This file is distributed under the same license as the Sphinx project.
+# FIRST AUTHOR <EMAIL at ADDRESS>, 2008.
+#
+#, fuzzy
+msgid ""
+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"
+"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"
+"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"
+
+#: sphinx/builder.py:390
+#, python-format
+msgid "%b %d, %Y"
+msgstr ""
+
+#: sphinx/builder.py:409 sphinx/templates/defindex.html:21
+msgid "General Index"
+msgstr ""
+
+#: sphinx/builder.py:409
+msgid "index"
+msgstr ""
+
+#: sphinx/builder.py:411 sphinx/templates/defindex.html:19
+#: sphinx/templates/modindex.html:2 sphinx/templates/modindex.html:12
+msgid "Global Module Index"
+msgstr ""
+
+#: sphinx/builder.py:411
+msgid "modules"
+msgstr ""
+
+#: sphinx/builder.py:447
+msgid "next"
+msgstr ""
+
+#: sphinx/builder.py:454
+msgid "previous"
+msgstr ""
+
+#: sphinx/environment.py:108 sphinx/latexwriter.py:110
+#, python-format
+msgid "%B %d, %Y"
+msgstr ""
+
+#: sphinx/templates/defindex.html:2
+msgid "Overview"
+msgstr ""
+
+#: sphinx/templates/defindex.html:11
+msgid "Indices and tables:"
+msgstr ""
+
+#: sphinx/templates/defindex.html:14
+msgid "Complete Table of Contents"
+msgstr ""
+
+#: sphinx/templates/defindex.html:15
+msgid "lists all sections and subsections"
+msgstr ""
+
+#: sphinx/templates/defindex.html:16
+msgid "Search page"
+msgstr ""
+
+#: sphinx/templates/defindex.html:17
+msgid "search this documentation"
+msgstr ""
+
+#: sphinx/templates/defindex.html:20
+msgid "quick access to all modules"
+msgstr ""
+
+#: sphinx/templates/defindex.html:22
+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
+msgid "Full index on one page"
+msgstr ""
+
+#: sphinx/templates/genindex-split.html:7
+msgid "Index pages by letter"
+msgstr ""
+
+#: sphinx/templates/genindex-split.html:15
+msgid "can be huge"
+msgstr ""
+
+#: sphinx/templates/layout.html:9
+msgid "Navigation"
+msgstr ""
+
+#: sphinx/templates/layout.html:40
+msgid "Table Of Contents"
+msgstr ""
+
+#: sphinx/templates/layout.html:46
+msgid "Previous topic"
+msgstr ""
+
+#: sphinx/templates/layout.html:47
+msgid "previous chapter"
+msgstr ""
+
+#: sphinx/templates/layout.html:50
+msgid "Next topic"
+msgstr ""
+
+#: sphinx/templates/layout.html:51
+msgid "next chapter"
+msgstr ""
+
+#: sphinx/templates/layout.html:55
+msgid "This Page"
+msgstr ""
+
+#: sphinx/templates/layout.html:59
+msgid "Suggest Change"
+msgstr ""
+
+#: sphinx/templates/layout.html:60 sphinx/templates/layout.html:62
+msgid "Show Source"
+msgstr ""
+
+#: sphinx/templates/layout.html:71
+msgid "Quick search"
+msgstr ""
+
+#: sphinx/templates/layout.html:71
+msgid "Keyword search"
+msgstr ""
+
+#: sphinx/templates/layout.html:73
+msgid "Go"
+msgstr ""
+
+#: sphinx/templates/layout.html:78
+msgid "Enter a module, class or function name."
+msgstr ""
+
+#: sphinx/templates/layout.html:118
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr ""
+
+#: sphinx/templates/layout.html:127
+msgid "About these documents"
+msgstr ""
+
+#: sphinx/templates/layout.html:129
+msgid "Global table of contents"
+msgstr ""
+
+#: sphinx/templates/layout.html:130
+msgid "Global index"
+msgstr ""
+
+#: sphinx/templates/layout.html:131 sphinx/templates/search.html:2
+#: sphinx/templates/search.html:5
+msgid "Search"
+msgstr ""
+
+#: sphinx/templates/layout.html:133
+msgid "Copyright"
+msgstr ""
+
+#: sphinx/templates/layout.html:178
+#, python-format
+msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+msgstr ""
+
+#: sphinx/templates/layout.html:180
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr ""
+
+#: sphinx/templates/layout.html:183
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr ""
+
+#: sphinx/templates/layout.html:186
+#, python-format
+msgid ""
+"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+msgstr ""
+
+#: sphinx/templates/modindex.html:14
+msgid "Most popular modules:"
+msgstr ""
+
+#: sphinx/templates/modindex.html:23
+msgid "Show modules only available on these platforms"
+msgstr ""
+
+#: sphinx/templates/modindex.html:55
+msgid "Deprecated"
+msgstr ""
+
+#: sphinx/templates/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr ""
+
+#: 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 ""
+
+#: sphinx/templates/search.html:7
+msgid ""
+"From here you can search these documents. Enter your search\n"
+"    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 ""
+
+#: sphinx/templates/search.html:14
+msgid "search"
+msgstr ""
+
+#: sphinx/templates/search.html:18
+msgid "Search Results"
+msgstr ""
+
+#: sphinx/templates/search.html:20
+msgid "Your search did not match any results."
+msgstr ""
+
+#: sphinx/templates/changes/frameset.html:5
+#: sphinx/templates/changes/versionchanges.html:12
+#, python-format
+msgid "Changes in Version %(version)s &mdash; %(docstitle)s"
+msgstr ""
+
+#: sphinx/templates/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr ""
+
+#: sphinx/templates/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr ""
+
+#: sphinx/templates/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr ""
+
+#: sphinx/templates/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr ""
+
+#: sphinx/templates/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr ""
+

Modified: doctools/trunk/sphinx/quickstart.py
==============================================================================
--- doctools/trunk/sphinx/quickstart.py	(original)
+++ doctools/trunk/sphinx/quickstart.py	Fri Aug  8 12:54:00 2008
@@ -69,11 +69,14 @@
 # The full version, including alpha/beta/rc tags.
 release = '%(release)s'
 
+# The language for content autogenerated by Sphinx
+#language = None
+
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
 #today = ''
 # Else, today_fmt is used as the format for a strftime call.
-today_fmt = '%%B %%d, %%Y'
+#today_fmt = '%%B %%d, %%Y'
 
 # List of documents that shouldn't be included in the build.
 #unused_docs = []
@@ -131,7 +134,7 @@
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
-html_last_updated_fmt = '%%b %%d, %%Y'
+#html_last_updated_fmt = '%%b %%d, %%Y'
 
 # If true, SmartyPants will be used to convert quotes and dashes to
 # typographically correct entities.

Modified: doctools/trunk/sphinx/templates/changes/frameset.html
==============================================================================
--- doctools/trunk/sphinx/templates/changes/frameset.html	(original)
+++ doctools/trunk/sphinx/templates/changes/frameset.html	Fri Aug  8 12:54:00 2008
@@ -2,10 +2,10 @@
   "http://www.w3.org/TR/html4/frameset.dtd">
 <html>
   <head>
-    <title>Changes in Version {{ version }} &mdash; {{ docstitle }}</title>
+    <title>{% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} &mdash; {{ docstitle }}{% endtrans %}</title>
   </head>
   <frameset cols="45%,*">
     <frame name="main" src="changes.html">
     <frame name="src" src="about:blank">
   </frameset>
-</html>
\ No newline at end of file
+</html>

Modified: doctools/trunk/sphinx/templates/changes/rstsource.html
==============================================================================
--- doctools/trunk/sphinx/templates/changes/rstsource.html	(original)
+++ doctools/trunk/sphinx/templates/changes/rstsource.html	Fri Aug  8 12:54:00 2008
@@ -2,7 +2,7 @@
   "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
-    <title>{{ filename }} &mdash; {{ docstitle }}</title>
+    <title>{% trans filename=filename, docstitle=docstitle %}{{ filename }} &mdash; {{ docstitle }}{% endtrans %}</title>
     <style type="text/css">
       .hl { background-color: yellow }
     </style>
@@ -12,4 +12,4 @@
       {{ text }}
     </pre>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: doctools/trunk/sphinx/templates/changes/versionchanges.html
==============================================================================
--- doctools/trunk/sphinx/templates/changes/versionchanges.html	(original)
+++ doctools/trunk/sphinx/templates/changes/versionchanges.html	Fri Aug  8 12:54:00 2008
@@ -9,20 +9,20 @@
   <head>
     <link rel="stylesheet" href="default.css">
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>Changes in Version {{ version }} &mdash; {{ docstitle }}</title>
+    <title>{% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} &mdash; {{ docstitle }}{% endtrans %}</title>
   </head>
   <body>
     <div class="document">
       <div class="body">
-    <h1>Automatically generated list of changes in version {{ version }}</h1>
-    <h2>Library changes</h2>
+    <h1>{% trans version=version %}Automatically generated list of changes in version {{ version }}{% endtrans %}</h1>
+    <h2>{{ _('Library changes') }}</h2>
     {% for modname, changes in libchanges %}
     <h4>{{ modname }}</h4>
     {{ entries(changes) }}
     {% endfor %}
-    <h2>C API changes</h2>
+    <h2>{{ _('C API changes') }}</h2>
     {{ entries(apichanges) }}
-    <h2>Other changes</h2>
+    <h2>{{ _('Other changes') }}</h2>
     {% for (fn, title), changes in otherchanges %}
     <h4>{{ title }} <span style="font-size: 50%">({{ fn }})</span></h4>
     {{ entries(changes) }}
@@ -30,4 +30,4 @@
       </div>
     </div>
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: doctools/trunk/sphinx/templates/defindex.html
==============================================================================
--- doctools/trunk/sphinx/templates/defindex.html	(original)
+++ doctools/trunk/sphinx/templates/defindex.html	Fri Aug  8 12:54:00 2008
@@ -1,5 +1,5 @@
 {% extends "layout.html" %}
-{% set title = 'Overview' %}
+{% set title = _('Overview') %}
 {% block body %}
   <h1>{{ docstitle }}</h1>
   <p>
@@ -8,18 +8,18 @@
     {{ release }}{% if last_updated %}, last updated {{ last_updated }}{% endif %}{% endblock %}.
   </p>
   {% block tables %}
-  <p><strong>Indices and tables:</strong></p>
+  <p><strong>{{ _('Indices and tables:') }}</strong></p>
   <table class="contentstable" align="center"><tr>
     <td width="50%">
-      <p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Complete Table of Contents</a><br>
-         <span class="linkdescr">lists all sections and subsections</span></p>
-      <p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br>
-         <span class="linkdescr">search this documentation</span></p>
+      <p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">{{ _('Complete Table of Contents') }}</a><br>
+         <span class="linkdescr">{{ _('lists all sections and subsections') }}</span></p>
+      <p class="biglink"><a class="biglink" href="{{ pathto("search") }}">{{ _('Search page') }}</a><br>
+         <span class="linkdescr">{{ _('search this documentation') }}</span></p>
     </td><td width="50%">
-      <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">Global Module Index</a><br>
-         <span class="linkdescr">quick access to all modules</span></p>
-      <p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br>
-         <span class="linkdescr">all functions, classes, terms</span></p>
+      <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">{{ _('Global Module Index') }}</a><br>
+         <span class="linkdescr">{{ _('quick access to all modules') }}</span></p>
+      <p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">{{ _('General Index') }}</a><br>
+         <span class="linkdescr">{{ _('all functions, classes, terms') }}</span></p>
     </td></tr>
   </table>
   {% endblock %}

Modified: doctools/trunk/sphinx/templates/genindex-single.html
==============================================================================
--- doctools/trunk/sphinx/templates/genindex-single.html	(original)
+++ doctools/trunk/sphinx/templates/genindex-single.html	Fri Aug  8 12:54:00 2008
@@ -1,8 +1,8 @@
 {% extends "layout.html" %}
-{% set title = 'Index' %}
+{% set title = _('Index') %}
 {% block body %}
 
-   <h1 id="index">Index &ndash; {{ key }}</h1>
+   <h1 id="index">{% trans key=key %}Index &ndash; {{ key }}{% endtrans %}</h1>
 
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
@@ -11,7 +11,7 @@
 {%- set numitems = 0 %}
 {% for entryname, (links, subitems) in entries %}
 <dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a>
-  {%- for link in links[1:] %}, <a href="{{ link }}">[Link]</a>{% endfor -%}
+  {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%}
   {%- else -%}
 {{ entryname|e }}
   {%- endif -%}</dt>
@@ -41,5 +41,5 @@
      {% if not loop.last %}| {% endif %}
    {%- endfor %}</p>
 
-   <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p>
+   <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p>
 {% endblock %}

Modified: doctools/trunk/sphinx/templates/genindex-split.html
==============================================================================
--- doctools/trunk/sphinx/templates/genindex-split.html	(original)
+++ doctools/trunk/sphinx/templates/genindex-split.html	Fri Aug  8 12:54:00 2008
@@ -1,18 +1,18 @@
 {% extends "layout.html" %}
-{% set title = 'Index' %}
+{% set title = _('Index') %}
 {% block body %}
 
-   <h1 id="index">Index</h1>
+   <h1 id="index">{{ _('Index') }}</h1>
 
-   <p>Index pages by letter:</p>
+   <p>{{ _('Index pages by letter') }}:</p>
 
    <p>{% for key, dummy in genindexentries -%}
    <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a>
      {% if not loop.last %}| {% endif %}
    {%- endfor %}</p>
 
-   <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong>
-                                               (can be huge)</a></p>
+   <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong>
+                                               ({{ _('can be huge') }})</a></p>
 
 {% endblock %}
 
@@ -24,6 +24,6 @@
      {% if not loop.last %}| {% endif %}
    {%- endfor %}</p>
 
-   <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p>
+   <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p>
 {% endif %}
 {% endblock %}

Modified: doctools/trunk/sphinx/templates/genindex.html
==============================================================================
--- doctools/trunk/sphinx/templates/genindex.html	(original)
+++ doctools/trunk/sphinx/templates/genindex.html	Fri Aug  8 12:54:00 2008
@@ -1,8 +1,8 @@
 {% extends "layout.html" %}
-{% set title = 'Index' %}
+{% set title = _('Index') %}
 {% block body %}
 
-   <h1 id="index">Index</h1>
+   <h1 id="index">{{ _('Index') }}</h1>
 
    {% for key, dummy in genindexentries -%}
    <a href="#{{ key }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %}
@@ -45,12 +45,12 @@
 
 {% block sidebarrel %}
 {% if split_index %}
-   <h4>Index</h4>
+   <h4>{{ _('Index') }}</h4>
    <p>{% for key, dummy in genindexentries -%}
    <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a>
      {% if not loop.last %}| {% endif %}
    {%- endfor %}</p>
 
-   <p><a href="{{ pathto('genindex-all') }}"><strong>Full index on one page</strong></a></p>
+   <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p>
 {% endif %}
 {% endblock %}

Modified: doctools/trunk/sphinx/templates/layout.html
==============================================================================
--- doctools/trunk/sphinx/templates/layout.html	(original)
+++ doctools/trunk/sphinx/templates/layout.html	Fri Aug  8 12:54:00 2008
@@ -6,7 +6,7 @@
 {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
 {%- macro relbar %}
     <div class="related">
-      <h3>Navigation</h3>
+      <h3>{{ _('Navigation') }}</h3>
       <ul>
         {%- for rellink in rellinks %}
         <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
@@ -37,29 +37,29 @@
           {%- endblock %}
           {%- block sidebartoc %}
           {%- if display_toc %}
-            <h3><a href="{{ pathto(master_doc) }}">Table Of Contents</a></h3>
+            <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
             {{ toc }}
           {%- endif %}
           {%- endblock %}
           {%- block sidebarrel %}
           {%- if prev %}
-            <h4>Previous topic</h4>
-            <p class="topless"><a href="{{ prev.link|e }}" title="previous chapter">{{ prev.title }}</a></p>
+            <h4>{{ _('Previous topic') }}</h4>
+            <p class="topless"><a href="{{ prev.link|e }}" title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
           {%- endif %}
           {%- if next %}
-            <h4>Next topic</h4>
-            <p class="topless"><a href="{{ next.link|e }}" title="next chapter">{{ next.title }}</a></p>
+            <h4>{{ _('Next topic') }}</h4>
+            <p class="topless"><a href="{{ next.link|e }}" title="{{ _('next chapter') }}">{{ next.title }}</a></p>
           {%- endif %}
           {%- endblock %}
           {%- if sourcename %}
-            <h3>This Page</h3>
+            <h3>{{ _('This Page') }}</h3>
             <ul class="this-page-menu">
             {%- if builder == 'web' %}
               <li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
-              <li><a href="{{ pathto('@edit/' + sourcename)|e }}">Suggest Change</a></li>
-              <li><a href="{{ pathto('@source/' + sourcename)|e }}">Show Source</a></li>
+              <li><a href="{{ pathto('@edit/' + sourcename)|e }}">{{ _('Suggest Change') }}</a></li>
+              <li><a href="{{ pathto('@source/' + sourcename)|e }}">{{ _('Show Source') }}</a></li>
             {%- elif builder == 'html' %}
-              <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">Show Source</a></li>
+              <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">{{ _('Show Source') }}</a></li>
             {%- endif %}
             </ul>
           {%- endif %}
@@ -68,14 +68,14 @@
           {%- endif %}
           {%- block sidebarsearch %}
           {%- if pagename != "search" %}
-            <h3>{{ builder == 'web' and 'Keyword' or 'Quick' }} search</h3>
+          <h3>{% if builder == 'web' %}{{ _('Keyword search')}}{% else %}{{ _('Quick search') }}{% endif %}</h3>
             <form class="search" action="{{ pathto('search') }}" method="get">
-              <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
+              <input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
               <input type="hidden" name="check_keywords" value="yes" />
               <input type="hidden" name="area" value="default" />
             </form>
             {%- if builder == 'web' %}
-            <p style="font-size: 90%">Enter a module, class or function name.</p>
+            <p style="font-size: 90%">{{ _('Enter a module, class or function name.') }}</p>
             {%- endif %}
           {%- endif %}
           {%- endblock %}
@@ -115,7 +115,7 @@
     {%- endfor %}
     {%- if use_opensearch %}
     <link rel="search" type="application/opensearchdescription+xml"
-          title="Search within {{ docstitle }}"
+          title="{% trans docstitle=docstitle%}Search within {{ docstitle }}{% endtrans %}"
           href="{{ pathto('_static/opensearch.xml', 1) }}"/>
     {%- endif %}
     {%- if favicon %}
@@ -124,13 +124,13 @@
     {%- endif %}
 {%- block rellinks %}
     {%- if hasdoc('about') %}
-    <link rel="author" title="About these documents" href="{{ pathto('about') }}" />
+    <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
     {%- endif %}
-    <link rel="contents" title="Global table of contents" href="{{ pathto('contents') }}" />
-    <link rel="index" title="Global index" href="{{ pathto('genindex') }}" />
-    <link rel="search" title="Search" href="{{ pathto('search') }}" />
+    <link rel="contents" title="{{ _('Global table of contents') }}" href="{{ pathto('contents') }}" />
+    <link rel="index" title="{{ _('Global index') }}" href="{{ pathto('genindex') }}" />
+    <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
     {%- if hasdoc('copyright') %}
-    <link rel="copyright" title="Copyright" href="{{ pathto('copyright') }}" />
+    <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
     {%- endif %}
     <link rel="top" title="{{ docstitle }}" href="{{ pathto('index') }}" />
     {%- if parents %}
@@ -175,15 +175,15 @@
 {%- block footer %}
     <div class="footer">
     {%- if hasdoc('copyright') %}
-      &copy; <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright }}.
+      {% trans path=pathto('copyright'), copyright=copyright %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
     {%- else %}
-      &copy; Copyright {{ copyright }}.
+      {% trans copyright=copyright %}&copy; Copyright {{ copyright }}.{% endtrans %}
     {%- endif %}
     {%- if last_updated %}
-      Last updated on {{ last_updated }}.
+      {% trans last_updated %}Last updated on {{ last_updated }}.{% endtrans %}
     {%- endif %}
     {%- if show_sphinx %}
-      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.
+      {% trans sphinx_version=sphinx_version %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
     {%- endif %}
     </div>
 {%- endblock %}

Modified: doctools/trunk/sphinx/templates/modindex.html
==============================================================================
--- doctools/trunk/sphinx/templates/modindex.html	(original)
+++ doctools/trunk/sphinx/templates/modindex.html	Fri Aug  8 12:54:00 2008
@@ -1,5 +1,5 @@
 {% extends "layout.html" %}
-{% set title = 'Global Module Index' %}
+{% set title = _('Global Module Index') %}
 {% block extrahead %}
 {% if collapse_modindex %}
     <script type="text/javascript">
@@ -9,9 +9,9 @@
 {% endblock %}
 {% block body %}
 
-   <h1 id="global-module-index">Global Module Index</h1>
+   <h1 id="global-module-index">{{ _('Global Module Index') }}</h1>
 {% if builder == 'web' and freqentries %}
-   <p>Most popular modules:</p>
+   <p>{{ _('Most popular modules:') }}</p>
    <div class="modulecloud">
    {%- for module in freqentries %}
      <a href="../q/{{ module.name|e }}/" style="font-size: {{ module.size }}%">{{ module.name|e }}</a>
@@ -20,7 +20,7 @@
 {% endif %}
 {% if builder == 'web' %}
    <form class="pfform" action="" method="get">
-     Show modules only available on these platforms:<br>
+     {{ _('Show modules only available on these platforms') }}:<br>
      {% for pl in platforms -%}
      <input type="checkbox" name="pf" value="{{ pl }}" id="pl-{{ pl }}"
             {%- if pl in showpf %} checked="checked"{% endif %}>
@@ -52,7 +52,7 @@
      <tt class="xref">{{ modname|e }}</tt>
      {%- if fname %}</a>{% endif %}
    {%- if pform[0] %} <em>({{ pform|join(', ') }})</em>{% endif -%}
-   </td><td>{% if dep %}<strong>Deprecated:</strong>{% endif %}
+   </td><td>{% if dep %}<strong>{{ _('Deprecated')}}:</strong>{% endif %}
      <em>{{ synops|e }}</em></td></tr>
    {%- endif -%}
    {% endfor %}

Modified: doctools/trunk/sphinx/templates/opensearch.xml
==============================================================================
--- doctools/trunk/sphinx/templates/opensearch.xml	(original)
+++ doctools/trunk/sphinx/templates/opensearch.xml	Fri Aug  8 12:54:00 2008
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>{{ project }}</ShortName>
-  <Description>Search {{ docstitle }}</Description>
+  <Description>{% trans docstitle=docstitle %}Search {{ docstitle }}{% endtrans %}</Description>
   <InputEncoding>utf-8</InputEncoding>
   <Url type="text/html" method="get"
        template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}&amp;check_keywords=yes&amp;area=default"/>

Modified: doctools/trunk/sphinx/templates/page.html
==============================================================================
--- doctools/trunk/sphinx/templates/page.html	(original)
+++ doctools/trunk/sphinx/templates/page.html	Fri Aug  8 12:54:00 2008
@@ -5,9 +5,7 @@
 {% block body %}
   {% if oldurl %}
   <div class="docwarning">
-    <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.
+    {% trans %}<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.{% endtrans %}
   </div>
   {% endif %}
   {{ body }}

Modified: doctools/trunk/sphinx/templates/search.html
==============================================================================
--- doctools/trunk/sphinx/templates/search.html	(original)
+++ doctools/trunk/sphinx/templates/search.html	Fri Aug  8 12:54:00 2008
@@ -1,23 +1,23 @@
 {% extends "layout.html" %}
-{% set title = 'Search' %}
+{% set title = _('Search') %}
 {% set script_files = script_files + ['_static/searchtools.js'] %}
 {% block body %}
-  <h1 id="search-documentation">Search</h1>
+  <h1 id="search-documentation">{{ _('Search') }}</h1>
   <p>
-    From here you can search these documents. Enter your search
+    {% trans %}From here you can search these documents. Enter your search
     words into the box below and click "search". Note that the search
     function will automatically search for all of the words. Pages
-    containing less words won't appear in the result list.
+    containing less words won't appear in the result list.{% endtrans %}
   </p>
   <form action="" method="get">
     <input type="text" name="q" value="" />
-    <input type="submit" value="search" />
+    <input type="submit" value="{{ _('search') }}" />
     <span id="search-progress" style="padding-left: 10px"></span>
   </form>
   {% if search_performed %}
-    <h2>Search Results</h2>
+    <h2>{{ _('Search Results') }}</h2>
     {% if not search_results %}
-      <p>Your search did not match any results.</p>
+      <p>{{ _('Your search did not match any results.') }}</p>
     {% endif %}
   {% endif %}
   <div id="search-results">


More information about the Python-checkins mailing list