mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add regression test for gettext does not extract definition terms. Closes #975
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,6 +1,8 @@
|
||||
Release 1.2 (in development)
|
||||
============================
|
||||
|
||||
* PR#72: #975: Fix gettext does not extract definition terms before docutils 0.10.0
|
||||
|
||||
* PR#25: In inheritance diagrams, the first line of the class docstring
|
||||
is now the tooltip for the class.
|
||||
|
||||
|
||||
32
tests/root/i18n/definition_terms.po
Normal file
32
tests/root/i18n/definition_terms.po
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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: 2013-01-01 05:00\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 "i18n with definition terms"
|
||||
msgstr "I18N WITH DEFINITION TERMS"
|
||||
|
||||
msgid "Some term"
|
||||
msgstr "SOME TERM"
|
||||
|
||||
msgid "The corresponding definition"
|
||||
msgstr "THE CORRESPONDING DEFINITION"
|
||||
|
||||
msgid "Some other term"
|
||||
msgstr "SOME OTHER TERM"
|
||||
|
||||
msgid "The corresponding definition #2"
|
||||
msgstr "THE CORRESPONDING DEFINITION #2"
|
||||
11
tests/root/i18n/definition_terms.txt
Normal file
11
tests/root/i18n/definition_terms.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
:tocdepth: 2
|
||||
|
||||
i18n with definition terms
|
||||
==========================
|
||||
|
||||
Some term
|
||||
The corresponding definition
|
||||
|
||||
Some other term
|
||||
The corresponding definition #2
|
||||
|
||||
@@ -6,3 +6,4 @@
|
||||
external_links
|
||||
refs_inconsistency
|
||||
literalblock
|
||||
definition_terms
|
||||
|
||||
@@ -226,3 +226,20 @@ def test_i18n_literalblock_warning(app):
|
||||
expected_warning_expr = u'.*/i18n/literalblock.txt:\\d+: ' \
|
||||
u'WARNING: Literal block expected; none found.'
|
||||
assert re.search(expected_warning_expr, warnings)
|
||||
|
||||
|
||||
@with_app(buildername='text',
|
||||
confoverrides={'language': 'xx', 'locale_dirs': ['.'],
|
||||
'gettext_compact': False})
|
||||
def test_i18n_definition_terms(app):
|
||||
# regression test for #975
|
||||
app.builder.build(['i18n/definition_terms'])
|
||||
result = (app.outdir / 'i18n' / 'definition_terms.txt').text(encoding='utf-8')
|
||||
expect = (u"\nI18N WITH DEFINITION TERMS"
|
||||
u"\n**************************\n"
|
||||
u"\nSOME TERM"
|
||||
u"\n THE CORRESPONDING DEFINITION\n"
|
||||
u"\nSOME OTHER TERM"
|
||||
u"\n THE CORRESPONDING DEFINITION #2\n")
|
||||
|
||||
assert result == expect
|
||||
|
||||
Reference in New Issue
Block a user