Fix a bug in Build and Constants, and clean up some more nested translates

This commit is contained in:
Veronica K. B. Olsen
2021-02-16 19:42:50 +01:00
parent d5bd816676
commit 8f1c4af9fa
15 changed files with 621 additions and 355 deletions
+2 -6
View File
@@ -130,9 +130,7 @@ class NWDoc():
if showStatus and not isOrphan:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
self.tr("Opened Document"), self._theItem.itemName
)
self.tr("Opened Document: {0}").format(self._theItem.itemName)
)
return theText
@@ -178,9 +176,7 @@ class NWDoc():
if self._theItem is not None:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
self.tr("Saved Document"), self._theItem.itemName
)
self.tr("Saved Document: {0}").format(self._theItem.itemName)
)
return True
+2 -2
View File
@@ -1156,8 +1156,8 @@ class NWProject():
if nAuth == 1:
authString = self.bookAuthors[0]
elif nAuth > 1:
authString = "%s and %s" % (
", ".join(self.bookAuthors[0:-1]), self.bookAuthors[-1]
authString = "%s %s %s" % (
", ".join(self.bookAuthors[0:-1]), self.tr("and"), self.bookAuthors[-1]
)
return authString
+2 -2
View File
@@ -292,8 +292,8 @@ class Tokenizer():
docSize = len(self.theText)
if docSize > nwConst.MAX_DOCSIZE:
errVal = self.tr("Document '{0}' is too big ({1}). Skipping.").format(
self.theItem.itemName, f"{docSize/1.0e6:.2f} MB"
errVal = self.tr("Document '{0}' is too big ({1} MB). Skipping.").format(
self.theItem.itemName, f"{docSize/1.0e6:.2f}"
)
self.theText = "# %s\n\n%s\n\n" % (self.tr("ERROR"), errVal)
self.errData.append(errVal)
+2 -2
View File
@@ -28,9 +28,9 @@ import nw
import logging
import os
from time import time
from lxml import etree
from hashlib import sha256
from time import time
from nw.core.item import NWItem
from nw.common import checkHandle
@@ -199,7 +199,7 @@ class NWTree():
outFile.write("=================\n")
outFile.write("\n")
outFile.write("%-25s %-9s %-10s %s\n" % (
"File Name", "Class", "Layout", "Document Label",
"File Name", "Class", "Layout", "Document Label"
))
outFile.write("-"*tocLen + "\n")
outFile.write("\n".join(tocList))