Mercurial > babel > old > babel-test
comparison babel/messages/mofile.py @ 544:030ddf3f5b13
catalog.add() now returns the message instance (closes #245)
author | fschwarz |
---|---|
date | Sat, 19 Mar 2011 19:28:59 +0000 |
parents | f642c81ce8cc |
children |
comparison
equal
deleted
inserted
replaced
541:aa471d38bcde | 544:030ddf3f5b13 |
---|---|
123 >>> from gettext import GNUTranslations | 123 >>> from gettext import GNUTranslations |
124 >>> from StringIO import StringIO | 124 >>> from StringIO import StringIO |
125 | 125 |
126 >>> catalog = Catalog(locale='en_US') | 126 >>> catalog = Catalog(locale='en_US') |
127 >>> catalog.add('foo', 'Voh') | 127 >>> catalog.add('foo', 'Voh') |
128 <Message ...> | |
128 >>> catalog.add((u'bar', u'baz'), (u'Bahr', u'Batz')) | 129 >>> catalog.add((u'bar', u'baz'), (u'Bahr', u'Batz')) |
130 <Message ...> | |
129 >>> catalog.add('fuz', 'Futz', flags=['fuzzy']) | 131 >>> catalog.add('fuz', 'Futz', flags=['fuzzy']) |
132 <Message ...> | |
130 >>> catalog.add('Fizz', '') | 133 >>> catalog.add('Fizz', '') |
134 <Message ...> | |
131 >>> catalog.add(('Fuzz', 'Fuzzes'), ('', '')) | 135 >>> catalog.add(('Fuzz', 'Fuzzes'), ('', '')) |
136 <Message ...> | |
132 >>> buf = StringIO() | 137 >>> buf = StringIO() |
133 | 138 |
134 >>> write_mo(buf, catalog) | 139 >>> write_mo(buf, catalog) |
135 >>> buf.seek(0) | 140 >>> buf.seek(0) |
136 >>> translations = GNUTranslations(fp=buf) | 141 >>> translations = GNUTranslations(fp=buf) |