Fixed translation issues for media counts

This commit is contained in:
Aqueminivan 2019-10-19 18:03:59 -04:00
parent d669659e88
commit 01f2fda214

View File

@ -1104,10 +1104,11 @@ will be lost. Continue?"""))
if warnings: if warnings:
report += "\n".join(warnings) + "\n" report += "\n".join(warnings) + "\n"
if unused: if unused:
numberOfUnusedFilesLabel = str(len(unused))
if report: if report:
report += "\n\n\n" report += "\n\n\n"
report += _( report += numberOfUnusedFilesLabel + " "
str(len(unused)) + " files found in media folder not used by any cards:") report += ngettext("file found in media folder not used by any cards:", "files found in media folder not used by any cards:", int(numberOfUnusedFilesLabel))
report += "\n" + "\n".join(unused) report += "\n" + "\n".join(unused)
if nohave: if nohave:
if report: if report:
@ -1158,12 +1159,14 @@ will be lost. Continue?"""))
now = time.time() now = time.time()
if now - lastProgress >= 0.3: if now - lastProgress >= 0.3:
numberOfRemainingFilesToBeDeleted = len(unused) - c
lastProgress = now lastProgress = now
label = _("%d files remaining...") % (len(unused) - (c+1)) label = ngettext("%d file remaining...", "%d files remaining...", numberOfRemainingFilesToBeDeleted) % numberOfRemainingFilesToBeDeleted
self.progress.update(label) self.progress.update(label)
finally: finally:
self.progress.finish() self.progress.finish()
tooltip(_("Deleted %d files.") % c) numberOfFilesDeleted = c + 1
tooltip(ngettext("Deleted %d file.", "Deleted %d files.", numberOfFilesDeleted) % numberOfFilesDeleted)
diag.close() diag.close()
def onStudyDeck(self): def onStudyDeck(self):