Mercurial > babel > old > mirror
comparison babel/messages/catalog.py @ 204:9181a11feb81
Doctest for changes on [205].
author | palgarvio |
---|---|
date | Tue, 03 Jul 2007 19:20:28 +0000 |
parents | 3476d17c9909 |
children | aefe4ac123a2 |
comparison
equal
deleted
inserted
replaced
203:3476d17c9909 | 204:9181a11feb81 |
---|---|
535 >>> 'head' in catalog | 535 >>> 'head' in catalog |
536 False | 536 False |
537 >>> catalog.obsolete.values() | 537 >>> catalog.obsolete.values() |
538 [<Message 'head' (flags: [])>] | 538 [<Message 'head' (flags: [])>] |
539 | 539 |
540 # Include old msgid | |
541 >>> template = Catalog() | |
542 >>> template.add((u'shoe', u'shoes'), locations=[('util.py', 39)]) | |
543 >>> catalog = Catalog(locale='pt_PT') | |
544 >>> catalog.add((u'shoee', u'shoes'), (u'Sapato', u'Sapatos'), | |
545 ... locations=[('util.py', 39)]) | |
546 >>> catalog.update(template, include_old_msgid=True) | |
547 >>> len(catalog) | |
548 1 | |
549 >>> msg1 = catalog['shoe'] | |
550 >>> msg1.id | |
551 (u'shoe', u'shoes') | |
552 >>> msg1.string | |
553 (u'Sapato', u'Sapatos') | |
554 >>> msg1.old_msgid | |
555 [u'shoee', u'shoes'] | |
556 | |
540 :param template: the reference catalog, usually read from a POT file | 557 :param template: the reference catalog, usually read from a POT file |
541 :param no_fuzzy_matching: whether to use fuzzy matching of message IDs | 558 :param no_fuzzy_matching: whether to use fuzzy matching of message IDs |
542 :param include_old_msgid: include the old msgid as a comment when | 559 :param include_old_msgid: include the old msgid as a comment when |
543 updating the catalog | 560 updating the catalog |
544 """ | 561 """ |