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

View File

@@ -137,3 +137,15 @@ def test_gettext_index_entries(app):
# unexpected msgid existent
assert msgids == []
@with_app(buildername='gettext',
srcdir=(test_roots / 'test-intl'),
doctreedir=(test_roots / 'test-intl' / '_build' / 'doctree'))
def test_gettext_template(app):
app.builder.build_all()
assert (app.outdir / 'sphinx.pot').isfile()
result = (app.outdir / 'sphinx.pot').text(encoding='utf-8')
assert "Welcome" in result
assert "Sphinx %(version)s" in result