changeset 204:9181a11feb81

Doctest for changes on [205].
author palgarvio
date Tue, 03 Jul 2007 19:20:28 +0000
parents 3476d17c9909
children aefe4ac123a2
files babel/messages/catalog.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/babel/messages/catalog.py
+++ b/babel/messages/catalog.py
@@ -537,6 +537,23 @@
         >>> catalog.obsolete.values()
         [<Message 'head' (flags: [])>]
 
+        # 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
Copyright (C) 2012-2017 Edgewall Software