# HG changeset patch # User palgarvio # Date 1214498361 0 # Node ID 7e3136b0ff0b4a155e25ee93275efb35cd382ab1 # Parent 8c9dc94062c0fa341312fd2c8c64d53ee25ac38d Fix typo and add a test for translator comments with leading spaces. diff --git a/babel/messages/tests/extract.py b/babel/messages/tests/extract.py --- a/babel/messages/tests/extract.py +++ b/babel/messages/tests/extract.py @@ -175,7 +175,7 @@ buf = StringIO(""" # This shouldn't be in the output # because it didn't start with a comment tag -# do NOTE: this will no be a translation comment +# do NOTE: this will not be a translation comment # NOTE: This one will be msg = _(u'Foo Bar') """) @@ -249,6 +249,17 @@ self.assertEqual(u'Hi there!', messages[0][2]) self.assertEqual([], messages[0][3]) + def test_comment_tag_with_leading_space(self): + buf = StringIO(""" + #: A translation comment + #: with leading spaces +msg = _(u'Foo Bar') +""") + messages = list(extract.extract_python(buf, ('_',), [':'], {})) + self.assertEqual(u'Foo Bar', messages[0][2]) + self.assertEqual([u': A translation comment', u': with leading spaces'], + messages[0][3]) + def test_different_signatures(self): buf = StringIO(""" foo = _('foo', 'bar')