From a7cfb52ab63c22bc088ff2be519ada378bb3c29e Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 8 Aug 2008 10:54:00 +0000 Subject: [PATCH] Add i18n support, thanks to Horst Gutmann. --- CHANGES | 4 + babel.cfg | 5 + doc/conf.py | 4 +- doc/config.rst | 34 ++- setup.cfg | 12 + sphinx/_jinja.py | 44 ++- sphinx/builder.py | 47 ++- sphinx/config.py | 10 +- sphinx/environment.py | 2 +- sphinx/latexwriter.py | 2 +- sphinx/locale/de/LC_MESSAGES/sphinx.mo | Bin 0 -> 4932 bytes sphinx/locale/de/LC_MESSAGES/sphinx.po | 289 +++++++++++++++++++ sphinx/locale/sphinx.pot | 288 ++++++++++++++++++ sphinx/quickstart.py | 7 +- sphinx/templates/changes/frameset.html | 4 +- sphinx/templates/changes/rstsource.html | 4 +- sphinx/templates/changes/versionchanges.html | 12 +- sphinx/templates/defindex.html | 20 +- sphinx/templates/genindex-single.html | 8 +- sphinx/templates/genindex-split.html | 12 +- sphinx/templates/genindex.html | 8 +- sphinx/templates/layout.html | 46 +-- sphinx/templates/modindex.html | 10 +- sphinx/templates/opensearch.xml | 2 +- sphinx/templates/page.html | 4 +- sphinx/templates/search.html | 14 +- 26 files changed, 794 insertions(+), 98 deletions(-) create mode 100644 babel.cfg create mode 100644 sphinx/locale/de/LC_MESSAGES/sphinx.mo create mode 100644 sphinx/locale/de/LC_MESSAGES/sphinx.po create mode 100644 sphinx/locale/sphinx.pot diff --git a/CHANGES b/CHANGES index a06c409ff..9a45622f6 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,10 @@ New features added 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 diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 000000000..2018ec7ff --- /dev/null +++ b/babel.cfg @@ -0,0 +1,5 @@ +[extractors] +jinja = sphinx._jinja.babel_extract +[python: **.py] +[jinja: **/templates/**.html] +[jinja: **/templates/**.xml] diff --git a/doc/conf.py b/doc/conf.py index 06dca15df..b8bb4d8da 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,6 +19,8 @@ import sys, os, re # 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 @@ release = version # 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 = [] diff --git a/doc/config.rst b/doc/config.rst index fe740ce2d..c718a8ca8 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -96,6 +96,31 @@ General configuration 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 @@ General configuration 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 @@ General configuration 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 @@ that use Sphinx' HTMLWriter class. 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 @@ that use Sphinx' HTMLWriter class. 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 diff --git a/setup.cfg b/setup.cfg index cee7e3b52..23986bcff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,3 +5,15 @@ tag_date = true [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/ diff --git a/sphinx/_jinja.py b/sphinx/_jinja.py index 7b98f6763..70da90e0e 100644 --- a/sphinx/_jinja.py +++ b/sphinx/_jinja.py @@ -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 import Environment 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 @@ class SphinxFileSystemLoader(BaseLoader): 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 @@ class BuiltinTemplates(TemplateBridge): 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')) diff --git a/sphinx/builder.py b/sphinx/builder.py index 621e5af1a..3d36761db 100644 --- a/sphinx/builder.py +++ b/sphinx/builder.py @@ -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 os import time import codecs import shutil +import gettext import cPickle as pickle from os import path from cgi import escape @@ -64,6 +65,8 @@ class Builder(object): 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 @@ class Builder(object): # 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 @@ class StandaloneHTMLBuilder(Builder): # 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 @@ class StandaloneHTMLBuilder(Builder): 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 @@ class StandaloneHTMLBuilder(Builder): 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 diff --git a/sphinx/config.py b/sphinx/config.py index 27dd0c9ec..abf998fef 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -22,15 +22,17 @@ class Config(object): # 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 @@ class Config(object): 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), diff --git a/sphinx/environment.py b/sphinx/environment.py index e855e89cb..41e9ac97f 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -105,7 +105,7 @@ class DefaultSubstitutions(Transform): 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)) diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py index a24518929..2a073bc35 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/latexwriter.py @@ -107,7 +107,7 @@ class LaTeXTranslator(nodes.NodeVisitor): 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 '') diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo new file mode 100644 index 0000000000000000000000000000000000000000..70d5331efd94c92bf662fb8125fb48589a6d6a42 GIT binary patch literal 4932 zcmcJSOKcoT8GtLWJl4Ph;k`hp7@XK_X6$4m@Qxo^zhb=cYi(~<35Td>x@M-Bp6=P| zZaX#z4j>MDKwNgYtU$mbK)?k~Na4U*Vj~V9ArJ>(B_u9E+Dni)t$^>Z?y;S$BOxR# zd%o%Fs=xmFU-kQylMg(n_?hJIBmBK~LY@wP{`^Lz26_Aod{BlTQ0h})0DcV4z#qT> zzE8&Aq|`Lj@E!0vya>DSVfY;=a()5V;LC6Te&EeYorQz&-|z|ee&JgRIRShR&k1}x z{4)F?{5pIC{2@e?`Y{weep>Ptly$Gbhu|G}8lHHoQtyNxhp4U|g|coOiax6)uR=LT z2>Dfx50UeED0(~#QB{2dz88M8eE&1}HlAOCABMjvpZ^Z4JpU7loFR%jT`uu) z2Cl=8!W}4bo`Z6}Z$t6N_aR47zlNg!@1W@OM~GCF-+K>={9^`z{oDUxKpF^X2&W%JCmT zk@FIiT>1kPy-qSHb{~e~$5D6|PC&7H1BxDBg|g4{P|o)Ply$!>c?%*^{T7Pf{|fn4 zxA_pezXoOgDGqrG4#{DMhMP7ranLm*sXo&UgS0)NhlazXk!CiF7*#{FdMG@nhpwtK zjik3bp(g{~cBVNsI5gY~vi3+iI6cP;XIt%Tax|D`y-f7aBWbn2>|oBl?j^Gt5i%!E3Kb&_Y5q*)1r%;={!mUYu5U7fXUs#D{(jjQUX&Dm|E zGiOrD`V6k}mQZK@{!kmWho+!%#;y&18p0JBV8*)i%~BnaaLH z!{s;3JEv#Xm->^`+~MRaub+G$56varUSzP!R#1^YajnOE+>=xWXxuU4MgxOM2m zc9!*OqoZlBZQ~o&UeZXCYT{a>gVURSsB~!Y{`!I1RW)yV*j7ZU1vYa!(A^}=BMjMy zf;82M)6G0?ctcBoRn;YNSlc+`9n!$1sR>-8eXmKYx{!$5TsdVx^Rtt2Ms3RXQfm%PW(V7WjS8cC-%xXJu=9J+J zPGdhw9tu=DN1*j_BjpA+vMQzIQDq9Brg^>ptjgo47{mJyv3O6SfK>K|KKOF*<{5AE zph1j?8~g@+Ii)8G5bm6?Ult1wue;=PC{tMqD`hpS>Gh4ZCl=1{mDKdY%FNR8<1_Q~8w;D81M6#B6<@zNR%MFFzhxsh86O>rw84sB%fdp{C=We@v$? zOb{jVW@FG!k%5(^m4!oloUe`zl;ygzwcF!p8SWV+v}`;fZg8o|rt+*=89$sS znm3KBEX0i@qzu*cc->|LMI|9kE3>;bJsVIR^;q?>>Z1edzq#nc>QKG<|G(#F;;wO> z9IX#8`}thArOX&hRg7(;P0ieYk$cnW*8a^Xv#sLJ-=_YAmJ7J6H~png(zHy|1+9$h z-#Vn!O>xoYB81{bUgb?$#ND48Jrj~*a)FB!hZM^_k$3mFx%d{J(+F_>t?uT;e4&gi zccPXkQmjeQwW{`C=ubC#KI!}4{wXzSj?adEv>&gsk2Dww#U6S2spJns0?CH+E-YgvoK+gJ`Krn*CN z5+q^n-FcU}8Kjd)ak`1CS~d!OENwDUH!WwIO(O>5PSm+vm?+0olK7H|LeYxhP1&Ql1~JJyBO zB8Uh#5mdw&wc8X^HTSu=N5XN(xRABQ6gdF4Sa2;<$7NFUjTo9!lQ@`b(WF5)!@rv} zq-}2T?1+c`v1DQy_G%`ITBci!`1YV|E|{<){YP=L6dei2Jw{}I!Lb3goNzH7x9GUR z*YzvMPV$zWiJN47TF3k;J&W;8%pQjp4|4SqbtbMIZtd-^u94x{9t~P2%L6PY>8OM5 zG40H(tw%PYCF!J+FJ+F><dkS#FM|dQmY_ zsU-xrqwn$gSWMp}6Vbj(|Nl3lU#prt*z7s;t{hO^ieH{NhgoiaqZ*y%n+7Xvxj1wee)x6ZzBD(n> zLCSe?0+bEvbe&cLxZ_`J@n0mj82?yFbq0%frrWkYA<*DHya(rVfxaqnI5AGZR>*8l(j literal 0 HcmV?d00001 diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po new file mode 100644 index 000000000..c55c93674 --- /dev/null +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po @@ -0,0 +1,289 @@ +# German translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2008-08-07 21:40+0200\n" +"PO-Revision-Date: 2008-08-08 12:40+0000\n" +"Last-Translator: Horst Gutmann \n" +"Language-Team: de \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 – %(key)s" +msgstr "Stichwortverzeichnis – %(key)s" + +#: sphinx/templates/genindex-single.html:14 +msgid "Link" +msgstr "Link" + +#: sphinx/templates/genindex-single.html:44 +#: sphinx/templates/genindex-split.html:14 +#: sphinx/templates/genindex-split.html:27 sphinx/templates/genindex.html:54 +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 "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© 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 Sphinx " +"%(sphinx_version)s." +msgstr "" +"Mit Sphinx %(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 "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "Anmerkung: Du hast eine nicht länger gültige URL von diesem Server angefragt. Wir haben versucht dich auf die neue Adresse dieser Seite umzuleiten, aber dies muss nicht die richtige Seite sein." + +#: 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 — %(docstitle)s" +msgstr "Änderungen in Version %(version)s — %(docstitle)s" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(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" diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot new file mode 100644 index 000000000..65cc1a645 --- /dev/null +++ b/sphinx/locale/sphinx.pot @@ -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 , 2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2008-08-08 12:39+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \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 – %(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 "© Copyright %(copyright)s." +msgstr "" + +#: sphinx/templates/layout.html:180 +#, python-format +msgid "© 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 Sphinx " +"%(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 "" +"Note: You requested an out-of-date URL from this server." +" We've tried to redirect you to the new location of this page, but it may" +" not be the right one." +msgstr "" + +#: 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 — %(docstitle)s" +msgstr "" + +#: sphinx/templates/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(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 "" + diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index a62ea8a21..0dc088775 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -69,11 +69,14 @@ version = '%(version)s' # 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 @@ html_static_path = ['%(dot)sstatic'] # 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. diff --git a/sphinx/templates/changes/frameset.html b/sphinx/templates/changes/frameset.html index e464f5de4..6d0535334 100644 --- a/sphinx/templates/changes/frameset.html +++ b/sphinx/templates/changes/frameset.html @@ -2,10 +2,10 @@ "http://www.w3.org/TR/html4/frameset.dtd"> - Changes in Version {{ version }} — {{ docstitle }} + {% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %} - \ No newline at end of file + diff --git a/sphinx/templates/changes/rstsource.html b/sphinx/templates/changes/rstsource.html index 34936e12b..a4b3c53ce 100644 --- a/sphinx/templates/changes/rstsource.html +++ b/sphinx/templates/changes/rstsource.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - {{ filename }} — {{ docstitle }} + {% trans filename=filename, docstitle=docstitle %}{{ filename }} — {{ docstitle }}{% endtrans %} @@ -12,4 +12,4 @@ {{ text }} - \ No newline at end of file + diff --git a/sphinx/templates/changes/versionchanges.html b/sphinx/templates/changes/versionchanges.html index 48d41a219..5a58e22a4 100644 --- a/sphinx/templates/changes/versionchanges.html +++ b/sphinx/templates/changes/versionchanges.html @@ -9,20 +9,20 @@ - Changes in Version {{ version }} — {{ docstitle }} + {% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ docstitle }}{% endtrans %}
-

Automatically generated list of changes in version {{ version }}

-

Library changes

+

{% trans version=version %}Automatically generated list of changes in version {{ version }}{% endtrans %}

+

{{ _('Library changes') }}

{% for modname, changes in libchanges %}

{{ modname }}

{{ entries(changes) }} {% endfor %} -

C API changes

+

{{ _('C API changes') }}

{{ entries(apichanges) }} -

Other changes

+

{{ _('Other changes') }}

{% for (fn, title), changes in otherchanges %}

{{ title }} ({{ fn }})

{{ entries(changes) }} @@ -30,4 +30,4 @@
- \ No newline at end of file + diff --git a/sphinx/templates/defindex.html b/sphinx/templates/defindex.html index a29dc7ee7..69beafc44 100644 --- a/sphinx/templates/defindex.html +++ b/sphinx/templates/defindex.html @@ -1,5 +1,5 @@ {% extends "layout.html" %} -{% set title = 'Overview' %} +{% set title = _('Overview') %} {% block body %}

{{ docstitle }}

@@ -8,18 +8,18 @@ {{ release }}{% if last_updated %}, last updated {{ last_updated }}{% endif %}{% endblock %}.

{% block tables %} -

Indices and tables:

+

{{ _('Indices and tables:') }}

- - + + - - + +
{% endblock %} diff --git a/sphinx/templates/genindex-single.html b/sphinx/templates/genindex-single.html index a7c49a898..99e00f6c6 100644 --- a/sphinx/templates/genindex-single.html +++ b/sphinx/templates/genindex-single.html @@ -1,8 +1,8 @@ {% extends "layout.html" %} -{% set title = 'Index' %} +{% set title = _('Index') %} {% block body %} -

Index – {{ key }}

+

{% trans key=key %}Index – {{ key }}{% endtrans %}

@@ -11,7 +11,7 @@ {%- set numitems = 0 %} {% for entryname, (links, subitems) in entries %}
{%- if links -%}{{ entryname|e }} - {%- for link in links[1:] %}, [Link]{% endfor -%} + {%- for link in links[1:] %}, [{{ loop.index }}]{% endfor -%} {%- else -%} {{ entryname|e }} {%- endif -%}
@@ -41,5 +41,5 @@ {% if not loop.last %}| {% endif %} {%- endfor %}

-

Full index on one page

+

{{ _('Full index on one page') }}

{% endblock %} diff --git a/sphinx/templates/genindex-split.html b/sphinx/templates/genindex-split.html index be6da9e28..d84032deb 100644 --- a/sphinx/templates/genindex-split.html +++ b/sphinx/templates/genindex-split.html @@ -1,18 +1,18 @@ {% extends "layout.html" %} -{% set title = 'Index' %} +{% set title = _('Index') %} {% block body %} -

Index

+

{{ _('Index') }}

-

Index pages by letter:

+

{{ _('Index pages by letter') }}:

{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}

-

Full index on one page - (can be huge)

+

{{ _('Full index on one page') }} + ({{ _('can be huge') }})

{% endblock %} @@ -24,6 +24,6 @@ {% if not loop.last %}| {% endif %} {%- endfor %}

-

Full index on one page

+

{{ _('Full index on one page') }}

{% endif %} {% endblock %} diff --git a/sphinx/templates/genindex.html b/sphinx/templates/genindex.html index 5ad6bdb7d..976cc8b13 100644 --- a/sphinx/templates/genindex.html +++ b/sphinx/templates/genindex.html @@ -1,8 +1,8 @@ {% extends "layout.html" %} -{% set title = 'Index' %} +{% set title = _('Index') %} {% block body %} -

Index

+

{{ _('Index') }}

{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} @@ -45,12 +45,12 @@ {% block sidebarrel %} {% if split_index %} -

Index

+

{{ _('Index') }}

{% for key, dummy in genindexentries -%} {{ key }} {% if not loop.last %}| {% endif %} {%- endfor %}

-

Full index on one page

+

{{ _('Full index on one page') }}

{% endif %} {% endblock %} diff --git a/sphinx/templates/layout.html b/sphinx/templates/layout.html index b9dab362e..c6cc20df2 100644 --- a/sphinx/templates/layout.html +++ b/sphinx/templates/layout.html @@ -6,7 +6,7 @@ {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} {%- macro relbar %}