diff options
author | georg.brandl <devnull@localhost> | 2008-08-08 10:54:00 +0000 |
---|---|---|
committer | georg.brandl <devnull@localhost> | 2008-08-08 10:54:00 +0000 |
commit | 57f6c6ef39b89e73511223c5691136b24fc65c0e (patch) | |
tree | 1cb54159ced778ff7837e7597cf19935edfad037 | |
parent | 1b414366e5925698d05e0fa94171a021efd7b253 (diff) | |
download | sphinx-57f6c6ef39b89e73511223c5691136b24fc65c0e.tar.gz |
Add i18n support, thanks to Horst Gutmann.
26 files changed, 794 insertions, 98 deletions
@@ -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 00000000..2018ec7f --- /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 06dca15d..b8bb4d8d 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 fe740ce2..c718a8ca 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 @@ -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 7b98f676..70da90e0 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 621e5af1..3d36761d 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 27dd0c9e..abf998fe 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 e855e89c..41e9ac97 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 a2451892..2a073bc3 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 Binary files differnew file mode 100644 index 00000000..70d5331e --- /dev/null +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po new file mode 100644 index 00000000..c55c9367 --- /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. +# <EMAIL@ADDRESS>, 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 <zerok@zerokspot.com>\n" +"Language-Team: de <LL@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 – %(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 "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Copyright</a> %(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 <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 — %(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 00000000..65cc1a64 --- /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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@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 – %(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 "© <a href=\"%(path)s\">Copyright</a> %(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 <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 — %(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 a62ea8a2..0dc08877 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 e464f5de..6d053533 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"> <html> <head> - <title>Changes in Version {{ version }} — {{ docstitle }}</title> + <title>{% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ 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> diff --git a/sphinx/templates/changes/rstsource.html b/sphinx/templates/changes/rstsource.html index 34936e12..a4b3c53c 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"> <html> <head> - <title>{{ filename }} — {{ docstitle }}</title> + <title>{% trans filename=filename, docstitle=docstitle %}{{ filename }} — {{ 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> diff --git a/sphinx/templates/changes/versionchanges.html b/sphinx/templates/changes/versionchanges.html index 48d41a21..5a58e22a 100644 --- a/sphinx/templates/changes/versionchanges.html +++ b/sphinx/templates/changes/versionchanges.html @@ -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 }} — {{ docstitle }}</title> + <title>{% trans version=version, docstitle=docstitle %}Changes in Version {{ version }} — {{ 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> diff --git a/sphinx/templates/defindex.html b/sphinx/templates/defindex.html index a29dc7ee..69beafc4 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 %} <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 %} diff --git a/sphinx/templates/genindex-single.html b/sphinx/templates/genindex-single.html index a7c49a89..99e00f6c 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 %} - <h1 id="index">Index – {{ key }}</h1> + <h1 id="index">{% trans key=key %}Index – {{ 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 %} diff --git a/sphinx/templates/genindex-split.html b/sphinx/templates/genindex-split.html index be6da9e2..d84032de 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 %} - <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 %} diff --git a/sphinx/templates/genindex.html b/sphinx/templates/genindex.html index 5ad6bdb7..976cc8b1 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 %} - <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 %} diff --git a/sphinx/templates/layout.html b/sphinx/templates/layout.html index b9dab362..c6cc20df 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 %} <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') %} - © <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright }}. + {% trans path=pathto('copyright'), copyright=copyright %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} {%- else %} - © Copyright {{ copyright }}. + {% trans copyright=copyright %}© 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 %} diff --git a/sphinx/templates/modindex.html b/sphinx/templates/modindex.html index d0a20852..2460f0fd 100644 --- a/sphinx/templates/modindex.html +++ b/sphinx/templates/modindex.html @@ -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 %} diff --git a/sphinx/templates/opensearch.xml b/sphinx/templates/opensearch.xml index 4e1fec03..5b6ab7bf 100644 --- a/sphinx/templates/opensearch.xml +++ b/sphinx/templates/opensearch.xml @@ -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}&check_keywords=yes&area=default"/> diff --git a/sphinx/templates/page.html b/sphinx/templates/page.html index ce4aef0d..4de23b13 100644 --- a/sphinx/templates/page.html +++ b/sphinx/templates/page.html @@ -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 }} diff --git a/sphinx/templates/search.html b/sphinx/templates/search.html index dd02c160..f41ac4f5 100644 --- a/sphinx/templates/search.html +++ b/sphinx/templates/search.html @@ -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"> |