diff --git a/tabellio/documents/document.py b/tabellio/documents/document.py index 5dc46a8..fce4350 100644 --- a/tabellio/documents/document.py +++ b/tabellio/documents/document.py @@ -57,7 +57,8 @@ class Document(Item, BasePublication): @property def doctype_str(self): - return typenames.MAPPING.get(self.doctype, u'Document (%s)' % self.doctype) + if self.doctype is None: return _('Unknown') + return typenames.MAPPING.get(self.doctype, self.doctype) @property def reftitle(self): diff --git a/tabellio/documents/dossier.py b/tabellio/documents/dossier.py index 899a145..0829f59 100644 --- a/tabellio/documents/dossier.py +++ b/tabellio/documents/dossier.py @@ -179,7 +179,8 @@ class Dossier(Item, BasePublication): @property def dostype_str(self): - return typenames.MAPPING.get(self.dostype, u'Dossier (%s)' % self.dostype) + if self.dostype is None: return _('Unknown') + return typenames.MAPPING.get(self.dostype, self.dostype) @property def state_str(self): diff --git a/tabellio/documents/question.py b/tabellio/documents/question.py index 15b2acc..acc4e66 100644 --- a/tabellio/documents/question.py +++ b/tabellio/documents/question.py @@ -104,7 +104,8 @@ class Question(Item, BasePublication): @property def questype_str(self): - return typenames.MAPPING.get(self.questype, u'Question (%s)' % self.questype) + if self.questype is None: return _('Unknown') + return typenames.MAPPING.get(self.questype, self.questype) @property def state_str(self):