diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index cf6270c..f8d6d81 100644
a
|
b
|
def templatize(src, origin=None):
|
586 | 586 | else: |
587 | 587 | out.write(blankout(p, 'F')) |
588 | 588 | elif t.token_type == TOKEN_COMMENT: |
589 | | out.write(' # %s' % t.contents) |
| 589 | out.write(' # %s\n' % t.contents) |
590 | 590 | else: |
591 | 591 | out.write(blankout(t.contents, 'X')) |
592 | 592 | return force_str(out.getvalue()) |
diff --git a/tests/regressiontests/i18n/commands/extraction.py b/tests/regressiontests/i18n/commands/extraction.py
index aa5efe1..2f1fbd0 100644
a
|
b
|
class BasicExtractorTests(ExtractorTests):
|
62 | 62 | self.assertTrue('#. Translators: This comment should be extracted' in po_contents) |
63 | 63 | self.assertTrue('This comment should not be extracted' not in po_contents) |
64 | 64 | # Comments in templates |
| 65 | # The comment on the same line shouldn't mask the translatable string |
| 66 | self.assertTrue('msgid "Translatable literal #0"' in po_contents) |
| 67 | |
65 | 68 | self.assertTrue('#. Translators: Django template comment for translators' in po_contents) |
66 | 69 | self.assertTrue("#. Translators: Django comment block for translators\n#. string's meaning unveiled" in po_contents) |
67 | 70 | |
… |
… |
class NoLocationExtractorTests(ExtractorTests):
|
284 | 287 | self.assertTrue(os.path.exists(self.PO_FILE)) |
285 | 288 | with open(self.PO_FILE, 'r') as fp: |
286 | 289 | po_contents = force_text(fp.read()) |
287 | | self.assertFalse('#: templates/test.html:55' in po_contents) |
| 290 | self.assertFalse('#: templates/test.html:56' in po_contents) |
288 | 291 | |
289 | 292 | def test_no_location_disabled(self): |
290 | 293 | os.chdir(self.test_dir) |
… |
… |
class NoLocationExtractorTests(ExtractorTests):
|
292 | 295 | self.assertTrue(os.path.exists(self.PO_FILE)) |
293 | 296 | with open(self.PO_FILE, 'r') as fp: |
294 | 297 | po_contents = force_text(fp.read()) |
295 | | self.assertTrue('#: templates/test.html:55' in po_contents) |
| 298 | self.assertTrue('#: templates/test.html:56' in po_contents) |
diff --git a/tests/regressiontests/i18n/commands/templates/test.html b/tests/regressiontests/i18n/commands/templates/test.html
index e7d7f3c..7d78bd8 100644
a
|
b
|
string's meaning unveiled
|
9 | 9 | <p>{% blocktrans %}I think that 100% is more that 50% of anything.{% endblocktrans %}</p> |
10 | 10 | {% blocktrans with 'txt' as obj %}I think that 100% is more that 50% of {{ obj }}.{% endblocktrans %} |
11 | 11 | |
| 12 | {# Translators: comment on same line #}{% trans "Translatable literal #0" %} |
| 13 | |
12 | 14 | {% comment %}Some random comment |
13 | 15 | Some random comment |
14 | 16 | Translators: One-line translator comment #1 |