Add i18n capabilities for custom templates.

For example: The Sphinx reference documentation in doc directory provides
sphinx.pot file from ``doc/_templates/*.html`` by ``make gettext``.
This commit is contained in:
Takayuki Shimizukawa
2013-03-10 22:07:31 +09:00
parent 7b443298a3
commit 2c409959ac
9 changed files with 167 additions and 62 deletions
@@ -0,0 +1,5 @@
{% extends "layout.html" %}
{% block body %}
<h1>{{ _('Welcome') }}</h1>
<p>{%trans%}Sphinx {{ version }}{%endtrans%}</p>
{% endblock %}
+3
View File
@@ -5,3 +5,6 @@ import sys, os
project = 'Sphinx intl <Tests>'
source_suffix = '.txt'
keep_warnings = True
templates_path = ['_templates']
html_additional_pages = {'index': 'index.html'}
release = version = '2013.120'
+23
View File
@@ -0,0 +1,23 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2012, foof
# This file is distributed under the same license as the foo package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sphinx 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-11-22 08:28\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"
msgid "Welcome"
msgstr "WELCOME"
msgid "Sphinx %(version)s"
msgstr "SPHINX %(version)s"