This commit is contained in:
Nozomu Kaneko
2013-01-05 20:43:45 +09:00
6 changed files with 157 additions and 5 deletions
+39
View File
@@ -0,0 +1,39 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2010, Georg Brandl & Team
# This file is distributed under the same license as the Sphinx <Tests> package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Sphinx <Tests> 0.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-12-16 14:11\n"
"PO-Revision-Date: 2012-12-18 06:14+0900\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 "i18n with docfields"
msgstr "I18N WITH DOCFIELDS"
msgid "description of parameter param"
msgstr "DESCRIPTION OF PARAMETER param"
msgid "description of parameter foo"
msgstr "DESCRIPTION OF PARAMETER foo"
msgid "description of parameter bar"
msgstr "DESCRIPTION OF PARAMETER bar"
msgid "if the values are not valid"
msgstr "IF THE VALUES ARE NOT VALID"
msgid "if the values are out of range"
msgstr "IF THE VALUES ARE OUT OF RANGE"
msgid "a new :class:`Cls3` instance"
msgstr "A NEW :class:`Cls3` INSTANCE"
+46
View File
@@ -0,0 +1,46 @@
:tocdepth: 2
i18n with docfields
===================
.. single TypedField
.. class:: Cls1
:noindex:
:param param: description of parameter param
.. grouped TypedFields
.. class:: Cls2
:noindex:
:param foo: description of parameter foo
:param bar: description of parameter bar
.. single GroupedField
.. class:: Cls3(values)
:noindex:
:raises ValueError: if the values are out of range
.. grouped GroupedFields
.. class:: Cls4(values)
:noindex:
:raises TypeError: if the values are not valid
:raises ValueError: if the values are out of range
.. single Field
.. class:: Cls5
:noindex:
:returns: a new :class:`Cls3` instance
.. Field is never grouped
+1
View File
@@ -8,3 +8,4 @@
literalblock
definition_terms
figure_caption
docfields
+37
View File
@@ -259,3 +259,40 @@ def test_i18n_figure_caption(app):
u"\n MY DESCRIPTION PARAGRAPH2 OF THE FIGURE.\n")
assert result == expect
@with_app(buildername='text', cleanenv=True,
confoverrides={'language': 'xx', 'locale_dirs': ['.'],
'gettext_compact': False})
def test_i18n_docfields(app):
app.builder.build(['i18n/docfields'])
result = (app.outdir / 'i18n' / 'docfields.txt').text(encoding='utf-8')
expect = (u"\nI18N WITH DOCFIELDS"
u"\n*******************\n"
u"\nclass class Cls1\n"
u"\n Parameters:"
u"\n **param** -- DESCRIPTION OF PARAMETER param\n"
u"\nclass class Cls2\n"
u"\n Parameters:"
u"\n * **foo** -- DESCRIPTION OF PARAMETER foo\n"
u"\n * **bar** -- DESCRIPTION OF PARAMETER bar\n"
u"\nclass class Cls3(values)\n"
u"\n Raises ValueError:"
u"\n IF THE VALUES ARE OUT OF RANGE\n"
u"\nclass class Cls4(values)\n"
u"\n Raises:"
u"\n * **TypeError** -- IF THE VALUES ARE NOT VALID\n"
u"\n * **ValueError** -- IF THE VALUES ARE OUT OF RANGE\n"
u"\nclass class Cls5\n"
u"\n Returns:"
u'\n A NEW "Cls3" INSTANCE\n')
assert result == expect
@with_app(buildername='html', cleanenv=True,
confoverrides={'language': 'xx', 'locale_dirs': ['.'],
'gettext_compact': False})
def test_i18n_docfields_html(app):
app.builder.build(['i18n/docfields'])
result = (app.outdir / 'i18n' / 'docfields.html').text(encoding='utf-8')
# expect no error by build