]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Fix typo and add a test for translator comments with leading spaces.
authorPedro Algarvio <pedro@algarvio.me>
Thu, 26 Jun 2008 16:39:21 +0000 (16:39 +0000)
committerPedro Algarvio <pedro@algarvio.me>
Thu, 26 Jun 2008 16:39:21 +0000 (16:39 +0000)
babel/messages/tests/extract.py

index 5d985184e685d69eaea5624e4cca73b73e6c31b8..917892fbe80663cc4c47993e6aa3a61194a53a3c 100644 (file)
@@ -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')