Fix translations and refactor makeAlert calls

This commit is contained in:
Veronica Berglyd Olsen
2021-06-10 21:42:40 +02:00
parent 904ba9b1ca
commit 6e1e40f13e
15 changed files with 252 additions and 297 deletions
+10 -15
View File
@@ -747,11 +747,10 @@ class GuiBuildNovel(QDialog):
tEnd = int(time())
logger.debug("Built project in %.3f ms" % (1000*(tEnd - tStart)))
if bldObj.errData:
self.theParent.makeAlert("%s:<br>-&nbsp;%s" % (
self.tr("There were problems when building the project"),
"<br>-&nbsp;".join(bldObj.errData)), nwAlert.ERROR
)
if bldObj.errData and isinstance(bldObj.errData, list):
self.theParent.makeAlert([
self.tr("There were problems when building the project:")
] + bldObj.errData, nwAlert.ERROR)
return
@@ -998,17 +997,13 @@ class GuiBuildNovel(QDialog):
# ==============
if wSuccess:
self.theParent.makeAlert(
"%s<br>%s" % (
self.tr("{0} file successfully written to:").format(textFmt), savePath
),
nwAlert.INFO
)
self.theParent.makeAlert([
self.tr("{0} file successfully written to:").format(textFmt), savePath
], nwAlert.INFO)
else:
self.theParent.makeAlert(
self.tr("Failed to write {0} file. {1}").format(textFmt, errMsg),
nwAlert.ERROR
)
self.theParent.makeAlert(self.tr(
"Failed to write {0} file. {1}"
).format(textFmt, errMsg), nwAlert.ERROR)
return wSuccess