From: Pedro Algarvio Date: Thu, 26 Jun 2008 16:39:21 +0000 (+0000) Subject: Fix typo and add a test for translator comments with leading spaces. X-Git-Tag: 1.0~313 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fba6f3a0a70dfa38bb86e68755ef60f4dca539;p=thirdparty%2Fbabel.git 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 index 5d985184..917892fb 100644 --- a/babel/messages/tests/extract.py +++ b/babel/messages/tests/extract.py @@ -175,7 +175,7 @@ msg = _(u'Foo Bar') 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 @@ hithere = _('Hi there!') 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')