support fuzzy and obsolete flags in ts entries
offlate/formats/entry.py
| 85 | 85 | numerus = entry.get('numerus') == 'yes' | |
| 86 | 86 | sourcestring = "" | |
| 87 | 87 | translation = [] if numerus else "" | |
| 88 | + | translationtype = None | |
| 88 | 89 | for child in entry: | |
| 89 | 90 | if child.tag == "source": | |
| 90 | 91 | sourcestring = child.text | |
| 91 | 92 | elif child.tag == "translation": | |
| 93 | + | translationtype = child.get('type') | |
| 92 | 94 | if numerus: | |
| 93 | 95 | for form in child: | |
| 94 | 96 | translation.append(form.text) | |
… | |||
| 99 | 101 | else: | |
| 100 | 102 | translation = [translation] | |
| 101 | 103 | sourcestring = [sourcestring] | |
| 102 | - | Entry.__init__(self, sourcestring, translation, False, False) | |
| 104 | + | fuzzy = False | |
| 105 | + | obsolete = False | |
| 106 | + | if translationtype == 'obsolete': | |
| 107 | + | obsolete = True | |
| 108 | + | if translationtype == 'unfinished': | |
| 109 | + | fuzzy = True | |
| 110 | + | Entry.__init__(self, sourcestring, translation, fuzzy, obsolete) | |
| 103 | 111 | ||
| 104 | 112 | def update(self, index, content): | |
| 105 | 113 | Entry.update(self, index, content) | |