afterjobs: don't use f-string in gettext calls (#57596)

This commit is contained in:
Frédéric Péters 2021-10-05 14:00:01 +02:00
parent 2855b67ab9
commit 7c3b994254
1 changed files with 6 additions and 3 deletions

View File

@ -86,10 +86,13 @@ class AfterJob(StorableObject):
return ''
if not self.total_count:
return _(f'{current_count} (unknown total)')
return _('%(current_count)s (unknown total)') % {'current_count': current_count}
percent = int(current_count * 100 / self.total_count)
return _(f'{current_count}/{self.total_count} ({percent}%)')
return _('%(current_count)s/%(total_count)s (%(percent)s%%)') % {
'current_count': current_count,
'total_count': self.total_count,
'percent': int(current_count * 100 / self.total_count),
}
def run(self, spool=False):
if self.completion_time: