From 01f2fda214745eb67e01b04de5d08a027d5df5ad Mon Sep 17 00:00:00 2001 From: Aqueminivan Date: Sat, 19 Oct 2019 18:03:59 -0400 Subject: [PATCH] Fixed translation issues for media counts --- aqt/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index 52c14187a..2ee0e3375 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -1104,10 +1104,11 @@ will be lost. Continue?""")) if warnings: report += "\n".join(warnings) + "\n" if unused: + numberOfUnusedFilesLabel = str(len(unused)) if report: report += "\n\n\n" - report += _( - str(len(unused)) + " files found in media folder not used by any cards:") + report += numberOfUnusedFilesLabel + " " + 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) if nohave: if report: @@ -1158,12 +1159,14 @@ will be lost. Continue?""")) now = time.time() if now - lastProgress >= 0.3: + numberOfRemainingFilesToBeDeleted = len(unused) - c lastProgress = now - label = _("%d files remaining...") % (len(unused) - (c+1)) + label = ngettext("%d file remaining...", "%d files remaining...", numberOfRemainingFilesToBeDeleted) % numberOfRemainingFilesToBeDeleted self.progress.update(label) finally: self.progress.finish() - tooltip(_("Deleted %d files.") % c) + numberOfFilesDeleted = c + 1 + tooltip(ngettext("Deleted %d file.", "Deleted %d files.", numberOfFilesDeleted) % numberOfFilesDeleted) diag.close() def onStudyDeck(self):