Mercurial > babel > old > babel-test
diff babel/messages/tests/pofile.py @ 441:f4c0d8fe8af9
Make sure to only strip on the first occurence of ].
Submitted by: Benoit Boissinot
author | jruigrok |
---|---|
date | Fri, 19 Feb 2010 13:08:56 +0000 |
parents | 6a62763f2fc4 |
children | ee29b66fafbf |
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py +++ b/babel/messages/tests/pofile.py @@ -200,7 +200,18 @@ self.assertEqual(1, catalog.num_plurals) message = catalog['foo'] self.assertEqual(1, len(message.string)) - + + def test_plural_with_square_brackets(self): + buf = StringIO(r'''msgid "foo" +msgid_plural "foo" +msgstr[0] "Voh [text]" +msgstr[1] "Vohs [text]"''') + catalog = pofile.read_po(buf, locale='nb_NO') + self.assertEqual(1, len(catalog)) + self.assertEqual(2, catalog.num_plurals) + message = catalog['foo'] + self.assertEqual(2, len(message.string)) + def test_more_than_two_plural_forms(self): buf = StringIO(r'''msgid "foo" msgid_plural "foo"