* Fixed catalogs' charset values not being recognized (ticket #66).
* Fixed fuzzy matching when updating message catalogs (ticket #82).
+ * Fixed bug in catalog updating, that in some cases pulled in
+ translations from different catalogs based on the same template.
Version 0.9.1
return cmp(self.id, obj.id[0])
return cmp(self.id, obj.id)
+ def clone(self):
+ return Message(self.id, self.string, self.locations, self.flags,
+ self.auto_comments, self.user_comments,
+ self.previous_id, self.lineno)
+
def fuzzy(self):
return 'fuzzy' in self.flags
fuzzy = property(fuzzy, doc="""\
fuzzy_matches = set()
def _merge(message, oldkey, newkey):
+ message = message.clone()
fuzzy = False
if oldkey != newkey:
fuzzy = True
cat.update(tmpl, no_fuzzy_matching=True)
self.assertEqual(2, len(cat.obsolete))
+ def test_update_no_template_mutation(self):
+ tmpl = catalog.Catalog()
+ tmpl.add('foo')
+ cat1 = catalog.Catalog()
+ cat1.add('foo', 'Voh')
+ cat1.update(tmpl)
+ cat2 = catalog.Catalog()
+ cat2.update(tmpl)
+
+ self.assertEqual(None, cat2['foo'].string)
+ self.assertEqual(False, cat2['foo'].fuzzy)
def suite():
suite = unittest.TestSuite()