Add info to po format
offlate/formats/entry.py
| 105 | 105 | for msgstr in entry.msgstr_plural: | |
| 106 | 106 | msgstrs.append(entry.msgstr_plural[msgstr]) | |
| 107 | 107 | msgids = [entry.msgid, entry.msgid_plural] | |
| 108 | - | Entry.__init__(self, msgids, msgstrs, "fuzzy" in entry.flags, entry.obsolete) | |
| 108 | + | info = [] | |
| 109 | + | for o in entry.occurrences: | |
| 110 | + | info.append({'type': 'location', 'file': o[0], 'line': o[1]}) | |
| 111 | + | if entry.comment is not None and entry.comment != '': | |
| 112 | + | info.append({'type': 'comment', 'comment': entry.comment}) | |
| 113 | + | if entry.tcomment is not None and entry.tcomment != '': | |
| 114 | + | info.append({'type': 'comment', 'comment': entry.tcomment}) | |
| 115 | + | Entry.__init__(self, msgids, msgstrs, "fuzzy" in entry.flags, entry.obsolete, info) | |
| 109 | 116 | self.entry = entry | |
| 110 | 117 | ||
| 111 | 118 | def update(self, index, content): |
offlate/ui/editor.py
| 366 | 366 | label.setWordWrap(True) | |
| 367 | 367 | if info['type'] == 'location': | |
| 368 | 368 | label.setText(self.tr('<b>location</b>: {0} line {1}'.format(info['file'], info['line']))) | |
| 369 | + | if info['type'] == 'comment': | |
| 370 | + | label.setText(self.tr('<b>comment</b>: {0}'.format(info['comment']))) | |
| 369 | 371 | return label | |
| 370 | 372 | ||
| 371 | 373 | def modify(self): |