diff --git a/test/ucs-test/tests/85_ucs-translation-template/00_fuzzy_entries_on_merge b/test/ucs-test/tests/85_ucs-translation-template/00_fuzzy_entries_on_merge index 0d13d85..8833330 100755 --- a/test/ucs-test/tests/85_ucs-translation-template/00_fuzzy_entries_on_merge +++ b/test/ucs-test/tests/85_ucs-translation-template/00_fuzzy_entries_on_merge @@ -1,7 +1,7 @@ #!/usr/share/ucs-test/runner python ## desc: | ## univention-ucs-translation-merge fuzzy entries -## Does univention -ucs translation-merge create fuzzy entries correctly when +## Does univention-ucs-translation-merge create fuzzy entries correctly when ## merging into an existing translation? ## bugs: [41223] ## tags: [translation-template] @@ -50,8 +50,10 @@ def _change_entry_in_source_file(source_pkg_path, po_entry): with open(source_file_path, 'w') as changed_source, open(original_source_file, 'r') as fd: for i, line in enumerate(fd): if i == int(line_number) - 1: - logging.info('Changing %s in line %s', source_file, line_number) - line = line.replace(po_entry.msgid, 'C!{}'.format(po_entry.msgid)) + logging.info('Attempting to change %s in line %s', source_file, line_number) + lhs, msgid_from_source = line.split('_(') + msgid_from_source = msgid_from_source.replace(po_entry.msgid[0:1], 'C!') + line = lhs + msgid_from_source changed_source.write(line) os.unlink(original_source_file) @@ -127,7 +129,7 @@ if __name__ == '__main__': for po_path, changed_entry in changes: if not _entry_is_fuzzy(changed_entry, po_path): # Sometimes msgmerges fuzzy matching does not match the change and - # appends the entry as commented (obsolete) to the end of the file + # appends the entry as a comment to the end of the file if _entry_is_obsolete(changed_entry, po_path): logging.debug('Change not matched by fuzzy matching in PO file: %s', po_path) else: