diff --git a/src/renderer/src/components/Popups/BackupPopup.tsx b/src/renderer/src/components/Popups/BackupPopup.tsx index 26d30a4035..c16cafa70a 100644 --- a/src/renderer/src/components/Popups/BackupPopup.tsx +++ b/src/renderer/src/components/Popups/BackupPopup.tsx @@ -1,5 +1,5 @@ import { loggerService } from '@logger' -import { getProgressLabel } from '@renderer/i18n/label' +import { getBackupProgressLabel } from '@renderer/i18n/label' import { backup } from '@renderer/services/BackupService' import store from '@renderer/store' import { IpcChannel } from '@shared/IpcChannel' @@ -61,7 +61,7 @@ const PopupContainer: React.FC = ({ resolve }) => { progress: Math.floor(progressData.progress) }) } - return getProgressLabel(progressData.stage) + return getBackupProgressLabel(progressData.stage) } BackupPopup.hide = onCancel diff --git a/src/renderer/src/components/Popups/RestorePopup.tsx b/src/renderer/src/components/Popups/RestorePopup.tsx index 27224a98c8..3378004fff 100644 --- a/src/renderer/src/components/Popups/RestorePopup.tsx +++ b/src/renderer/src/components/Popups/RestorePopup.tsx @@ -1,4 +1,4 @@ -import { getProgressLabel } from '@renderer/i18n/label' +import { getRestoreProgressLabel } from '@renderer/i18n/label' import { restore } from '@renderer/services/BackupService' import { IpcChannel } from '@shared/IpcChannel' import { Modal, Progress } from 'antd' @@ -49,11 +49,11 @@ const PopupContainer: React.FC = ({ resolve }) => { if (!progressData) return '' if (progressData.stage === 'copying_files') { - return t('backup.progress.copying_files', { + return t('restore.progress.copying_files', { progress: Math.floor(progressData.progress) }) } - return getProgressLabel(progressData.stage) + return getRestoreProgressLabel(progressData.stage) } RestorePopup.hide = onCancel diff --git a/src/renderer/src/i18n/label.ts b/src/renderer/src/i18n/label.ts index 31bcd44287..5df6b42cef 100644 --- a/src/renderer/src/i18n/label.ts +++ b/src/renderer/src/i18n/label.ts @@ -96,17 +96,32 @@ export const getProviderLabel = (id: string): string => { return getLabel(id, providerKeyMap) } -const progressKeyMap = { +const backupProgressKeyMap = { completed: 'backup.progress.completed', compressing: 'backup.progress.compressing', copying_files: 'backup.progress.copying_files', + preparing_compression: 'backup.progress.preparing_compression', preparing: 'backup.progress.preparing', title: 'backup.progress.title', writing_data: 'backup.progress.writing_data' } as const -export const getProgressLabel = (key: string): string => { - return getLabel(key, progressKeyMap) +export const getBackupProgressLabel = (key: string): string => { + return getLabel(key, backupProgressKeyMap) +} + +const restoreProgressKeyMap = { + completed: 'restore.progress.completed', + copying_files: 'restore.progress.copying_files', + extracted: 'restore.progress.extracted', + extracting: 'restore.progress.extracting', + preparing: 'restore.progress.preparing', + reading_data: 'restore.progress.reading_data', + title: 'restore.progress.title' +} + +export const getRestoreProgressLabel = (key: string): string => { + return getLabel(key, restoreProgressKeyMap) } const titleKeyMap = { diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index b0a09110af..a74a7364c9 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -240,6 +240,7 @@ "compressing": "Compressing files...", "copying_files": "Copying files... {{progress}}%", "preparing": "Preparing backup...", + "preparing_compression": "Preparing compression...", "title": "Backup Progress", "writing_data": "Writing data..." }, diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 00da07ed51..7920f1a5ee 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -240,6 +240,7 @@ "compressing": "圧縮中...", "copying_files": "ファイルコピー中... {{progress}}%", "preparing": "バックアップ準備中...", + "preparing_compression": "圧縮準備中...", "title": "バックアップ進捗", "writing_data": "データ書き込み中..." }, diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 2d23a04f60..a00dc5bf47 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -240,6 +240,7 @@ "compressing": "Сжатие файлов...", "copying_files": "Копирование файлов... {{progress}}%", "preparing": "Подготовка резервной копии...", + "preparing_compression": "Подготовка сжатия...", "title": "Прогресс резервного копирования", "writing_data": "Запись данных..." }, diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 66b8e6a825..6d3f2af47e 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -240,6 +240,7 @@ "compressing": "压缩文件...", "copying_files": "复制文件... {{progress}}%", "preparing": "准备备份...", + "preparing_compression": "准备压缩...", "title": "备份进度", "writing_data": "写入数据..." }, diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 4f45de4d57..e0d12b4c1a 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -240,6 +240,7 @@ "compressing": "壓縮檔案...", "copying_files": "複製檔案... {{progress}}%", "preparing": "準備備份...", + "preparing_compression": "準備壓縮...", "title": "備份進度", "writing_data": "寫入資料..." }, diff --git a/src/renderer/src/i18n/translate/el-gr.json b/src/renderer/src/i18n/translate/el-gr.json index b5f481eaaa..4c4ed4ed18 100644 --- a/src/renderer/src/i18n/translate/el-gr.json +++ b/src/renderer/src/i18n/translate/el-gr.json @@ -240,6 +240,7 @@ "compressing": "Συμπίεση αρχείων...", "copying_files": "Αντιγραφή αρχείων... {{progress}}%", "preparing": "Ετοιμασία αντιγράφου ασφαλείας...", + "preparing_compression": "Ετοιμασία συμπίεσης...", "title": "Πρόοδος αντιγράφου ασφαλείας", "writing_data": "Εγγραφή δεδομένων..." }, diff --git a/src/renderer/src/i18n/translate/es-es.json b/src/renderer/src/i18n/translate/es-es.json index 6369bd26d8..c738217322 100644 --- a/src/renderer/src/i18n/translate/es-es.json +++ b/src/renderer/src/i18n/translate/es-es.json @@ -240,6 +240,7 @@ "compressing": "Comprimiendo archivos...", "copying_files": "Copiando archivos... {{progress}}%", "preparing": "Preparando copia de seguridad...", + "preparing_compression": "Preparando compresión...", "title": "Progreso de la copia de seguridad", "writing_data": "Escribiendo datos..." }, diff --git a/src/renderer/src/i18n/translate/fr-fr.json b/src/renderer/src/i18n/translate/fr-fr.json index 459e9930a0..4273f8c5a5 100644 --- a/src/renderer/src/i18n/translate/fr-fr.json +++ b/src/renderer/src/i18n/translate/fr-fr.json @@ -240,6 +240,7 @@ "compressing": "Compression des fichiers...", "copying_files": "Copie des fichiers... {{progress}}%", "preparing": "Préparation de la sauvegarde...", + "preparing_compression": "Préparation de la compression...", "title": "Progrès de la sauvegarde", "writing_data": "Écriture des données..." }, diff --git a/src/renderer/src/i18n/translate/pt-pt.json b/src/renderer/src/i18n/translate/pt-pt.json index a642dc7bb8..03b0c47fef 100644 --- a/src/renderer/src/i18n/translate/pt-pt.json +++ b/src/renderer/src/i18n/translate/pt-pt.json @@ -240,6 +240,7 @@ "compressing": "Comprimindo arquivo...", "copying_files": "Copiando arquivos... {{progress}}%", "preparing": "Preparando backup...", + "preparing_compression": "Preparando compressão...", "title": "Progresso do Backup", "writing_data": "Escrevendo dados..." },