fix: reporting correct line number when translations have wrong reST syntax or else.

This commit is contained in:
Takayuki Shimizukawa
2013-02-04 22:23:03 +09:00
parent 70f3f889d1
commit c1c0a03895
5 changed files with 62 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
subdir/contents
bom
warnings
footnote
external_links
refs_inconsistency

View File

@@ -0,0 +1,23 @@
# 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: 2013-02-04 13:06\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 reST warnings"
msgstr "I18N WITH REST WARNINGS"
msgid "line of ``literal`` markup."
msgstr "LINE OF ``BROKEN LITERAL MARKUP."

View File

@@ -0,0 +1,5 @@
i18n with reST warnings
========================
line of ``literal`` markup.

View File

@@ -89,6 +89,23 @@ def test_subdir(app):
assert result.startswith(u"\nsubdir contents\n***************\n")
@with_intl_app(buildername='text', warning=warnfile)
def test_i18n_warnings_in_translation(app):
app.builddir.rmtree(True)
app.builder.build(['warnings'])
result = (app.outdir / 'warnings.txt').text(encoding='utf-8')
expect = (u"\nI18N WITH REST WARNINGS"
u"\n***********************\n"
u"\nLINE OF >>``<<BROKEN LITERAL MARKUP.\n")
assert result == expect
warnings = warnfile.getvalue().replace(os.sep, '/')
warning_expr = u'.*/warnings.txt:4: ' \
u'WARNING: Inline literal start-string without end-string.\n'
assert re.search(warning_expr, warnings)
@with_intl_app(buildername='html', cleanenv=True)
def test_i18n_footnote_break_refid(app):
"""test for #955 cant-build-html-with-footnotes-when-using"""