From: Pedro Algarvio Date: Tue, 3 Jul 2007 19:20:28 +0000 (+0000) Subject: Doctest for changes on [205]. X-Git-Tag: 1.0~447 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5c3c823eb1398dbdb7c55658c1cf08cb7eb93be;p=thirdparty%2Fbabel.git Doctest for changes on [205]. --- diff --git a/babel/messages/catalog.py b/babel/messages/catalog.py index f5a9a72d..598a85f5 100644 --- a/babel/messages/catalog.py +++ b/babel/messages/catalog.py @@ -537,6 +537,23 @@ class Catalog(object): >>> catalog.obsolete.values() [] + # Include old msgid + >>> template = Catalog() + >>> template.add((u'shoe', u'shoes'), locations=[('util.py', 39)]) + >>> catalog = Catalog(locale='pt_PT') + >>> catalog.add((u'shoee', u'shoes'), (u'Sapato', u'Sapatos'), + ... locations=[('util.py', 39)]) + >>> catalog.update(template, include_old_msgid=True) + >>> len(catalog) + 1 + >>> msg1 = catalog['shoe'] + >>> msg1.id + (u'shoe', u'shoes') + >>> msg1.string + (u'Sapato', u'Sapatos') + >>> msg1.old_msgid + [u'shoee', u'shoes'] + :param template: the reference catalog, usually read from a POT file :param no_fuzzy_matching: whether to use fuzzy matching of message IDs :param include_old_msgid: include the old msgid as a comment when