Add the project localisation to the converter classes

This commit is contained in:
Veronica K. B. Olsen
2021-02-16 22:18:14 +01:00
parent b50132e255
commit 4699d9404b
5 changed files with 31 additions and 15 deletions
+6 -4
View File
@@ -405,18 +405,20 @@ class ToHtml(Tokenizer):
def _formatSynopsis(self, tText):
"""Apply HTML formatting to synopsis.
"""
sSynop = self._localLookup("Synopsis")
if self.genMode == self.M_PREVIEW:
return "<p class='comment'><span class='synopsis'>Synopsis:</span> %s</p>\n" % tText
return f"<p class='comment'><span class='synopsis'>{sSynop}:</span> {tText}</p>\n"
else:
return "<p class='synopsis'><strong>Synopsis:</strong> %s</p>\n" % tText
return f"<p class='synopsis'><strong>{sSynop}:</strong> {tText}</p>\n"
def _formatComments(self, tText):
"""Apply HTML formatting to comments.
"""
if self.genMode == self.M_PREVIEW:
return "<p class='comment'>%s</p>\n" % tText
return f"<p class='comment'>{tText}</p>\n"
else:
return "<p class='comment'><strong>Comment:</strong> %s</p>\n" % tText
sComm = self._localLookup("Comment")
return f"<p class='comment'><strong>{sComm}:</strong> {tText}</p>\n"
def _formatKeywords(self, tText):
"""Apply HTML formatting to keywords.