perf: Translate (#13550)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2024-07-01 11:42:33 +08:00
committed by GitHub
parent aeb320ba30
commit 6753b5fd19
13 changed files with 991 additions and 652 deletions

View File

@@ -3,6 +3,7 @@
import time
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from common.utils.timezone import local_now_display
from .handlers import AccountBackupHandler
@@ -19,7 +20,8 @@ class AccountBackupManager:
def do_run(self):
execution = self.execution
print('\n\033[33m# 账号备份计划正在执行\033[0m')
account_backup_execution_being_executed = _('The account backup plan is being executed')
print(f'\n\033[33m# {account_backup_execution_being_executed}\033[0m')
handler = AccountBackupHandler(execution)
handler.run()
@@ -32,9 +34,11 @@ class AccountBackupManager:
self.date_end = timezone.now()
print('\n\n' + '-' * 80)
print('计划执行结束 {}\n'.format(local_now_display()))
plan_execution_end = _('Plan execution end')
print('{} {}\n'.format(plan_execution_end, local_now_display()))
self.timedelta = self.time_end - self.time_start
print('用时: {}s'.format(self.timedelta))
time_cost = _('Time cost')
print('{}: {}s'.format(time_cost, self.timedelta))
self.execution.timedelta = self.timedelta
self.execution.save()