diff --git a/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py b/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py index bf182aa..259eb6d 100644 --- a/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py +++ b/branches/ucs-4.1/ucs-4.1-0/management/univention-management-console/dev/dh_umc.py @@ -221,15 +221,22 @@ def read_modules(package, core=False): def _appendPoEntry(poFile, xmlEntry): """Helper function to access text property of XML elements and to find the corresponding po-entry.""" - if xmlEntry is not None and xmlEntry.text is not None: # important to use "xmlEntry is non None"! - poFile.append(polib.POEntry(msgid=xmlEntry.text, msgstr='')) + if xmlEntry is None: + return + text = xmlEntry.text + if text is None: + return + try: + poFile.append(polib.POEntry(msgid=text, msgstr='')) + except ValueError: + print "I: duplicate entry: %s" % (text,) def module_xml2po(module, po_file, language): """Create a PO file the XML definition of an UMC module""" message_po = '%s/messages.po' % (os.path.dirname(po_file) or '.') - po = polib.POFile() + po = polib.POFile(check_for_duplicates=True) po.header = PO_HEADER po.metadata = copy.copy(PO_METADATA) po.metadata['Project-Id-Version'] = module.package