diff --git a/src/calibre/gui2/fts/dialog.py b/src/calibre/gui2/fts/dialog.py index d282c3cc2e..ec707f1d49 100644 --- a/src/calibre/gui2/fts/dialog.py +++ b/src/calibre/gui2/fts/dialog.py @@ -60,10 +60,11 @@ class FTSDialog(Dialog): except Exception: self.indexing_label.setVisible(False) else: - if p < 100: - t = _('Indexing is only {0:.0%} done').format(p) + if p < 1: + q = f'{p:.0%}' + t = _('Indexing is almost complete') if q == '100%' else _('Indexing is only {} done').format(q) ss = '' - if p < 90: + if p < 0.9: ss = 'QLabel { color: red }' self.indexing_label.setStyleSheet(ss) self.indexing_label.setText(t) diff --git a/src/calibre/gui2/fts/scan.py b/src/calibre/gui2/fts/scan.py index bbe04e4eb8..a4ef77de18 100644 --- a/src/calibre/gui2/fts/scan.py +++ b/src/calibre/gui2/fts/scan.py @@ -103,8 +103,11 @@ class ScanProgress(QWidget): self.switch_anyway.setText(_('Start &searching')) else: done = total - left - t = _('{0} of {1} book files, {2:.0%} have been indexed').format( - done, total, done / (total or 1)) + p = done / (total or 1) + p = f'{p:.0%}' + if p == '100%': + p = _('almost 100%') + t = _('{0} of {1} book files, {2} have been indexed').format(done, total, p) self.warn_label.setVisible(True) self.switch_anyway.setIcon(QIcon.ic('dialog_warning.png')) self.switch_anyway.setText(_('Start &searching even with incomplete indexing'))