Mercurial > babel > mirror
diff babel/messages/tests/pofile.py @ 80:116e34b8cefa trunk
Added support for translator comments at the API and frontends levels.(See #12, item 1). Updated docs and tests accordingly.
author | palgarvio |
---|---|
date | Sun, 10 Jun 2007 14:21:01 +0000 |
parents | f40fc143439c |
children | dacfbaf0d1e0 |
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py +++ b/babel/messages/tests/pofile.py @@ -67,6 +67,26 @@ " throw us into an infinite " "loop\n" msgstr ""''', buf.getvalue().strip()) + + def test_pot_with_translator_comments(self): + catalog = Catalog() + catalog.add(u'foo', locations=[('main.py', 1)], + comments=['Comment About `foo`']) + catalog.add(u'bar', locations=[('utils.py', 3)], + comments=['Comment About `bar` with', + 'multiple lines.']) + buf = StringIO() + pofile.write_pot(buf, catalog, omit_header=True) + self.assertEqual('''#. Comment About `foo` +#: main.py:1 +msgid "foo" +msgstr "" + +#. Comment About `bar` with +#. multiple lines. +#: utils.py:3 +msgid "bar" +msgstr ""''', buf.getvalue().strip()) def suite():