ts: save obsolete flag
CHANGELOG.md
5 | 5 | ||
6 | 6 | ### Improvements and features ### | |
7 | 7 | ||
8 | + | * Fixed TS format not setting the obsolete flag when saving. | |
8 | 9 | * Whitespace characters are shown with a small symbol in the editor. Spaces get | |
9 | 10 | a small middle dot, no-break spaces get a line underneath. Tabs are also represented. | |
10 | 11 | * Some improvements have been made to the code documentation. |
offlate/formats/ts.py
260 | 260 | sourcestring = child.text | |
261 | 261 | break | |
262 | 262 | msgstrs = [] | |
263 | + | obsolete = False | |
263 | 264 | for entry in self.savedcontent: | |
264 | 265 | if entry.msgids[0] == sourcestring: | |
265 | 266 | msgstrs = entry.msgstrs | |
267 | + | obsolete = entry.isObsolete() | |
266 | 268 | for child in item: | |
267 | 269 | if child.tag == "translation": | |
268 | 270 | if numerus: | |
… | |||
273 | 275 | e.text = msgstrs[i] | |
274 | 276 | child.append(e) | |
275 | 277 | unfinished = unfinished or msgstrs[i] == '' | |
276 | - | if unfinished: | |
278 | + | if obsolete or child.get('type') == 'obsolete': | |
279 | + | child.set('type', 'obsolete') | |
280 | + | elif unfinished: | |
277 | 281 | child.set('type', 'unfinished') | |
278 | 282 | else: | |
279 | - | if msgstrs[0] != "": | |
283 | + | if obsolete or child.get('type') == 'obsolete': | |
284 | + | child.set('type', 'obsolete') | |
285 | + | elif msgstrs[0] != "": | |
280 | 286 | child.clear() | |
281 | 287 | else: | |
282 | 288 | child.set('type', 'unfinished') |