mirror of
https://github.com/borgbase/vorta
synced 2025-01-03 05:36:19 +00:00
Translate category labels for log output. By @samuel-w (#683)
This commit is contained in:
parent
cc47c1bc78
commit
5df80610e2
1 changed files with 10 additions and 4 deletions
|
@ -44,6 +44,12 @@ def __init__(self, cmd, params, parent=None):
|
|||
self.app = QApplication.instance()
|
||||
self.app.backup_cancelled_event.connect(self.cancel)
|
||||
|
||||
# Declare labels here for translation
|
||||
self.category_label = {"files": self.tr("Files"),
|
||||
"original": self.tr("Original"),
|
||||
"deduplicated": self.tr("Deduplicated"),
|
||||
"compressed": self.tr("Compressed"), }
|
||||
|
||||
cmd[0] = self.prepare_bin()
|
||||
|
||||
# Add extra Borg args to command. Never pass None.
|
||||
|
@ -204,10 +210,10 @@ def read_async(fd):
|
|||
self.app.backup_log_event.emit(f'{parsed["path"]} ({parsed["status"]})')
|
||||
elif parsed['type'] == 'archive_progress':
|
||||
msg = (
|
||||
f"Files: {parsed['nfiles']}, "
|
||||
f"Original: {pretty_bytes(parsed['original_size'])}, "
|
||||
f"Deduplicated: {pretty_bytes(parsed['deduplicated_size'])}, "
|
||||
f"Compressed: {pretty_bytes(parsed['compressed_size'])}"
|
||||
f"{self.category_label['files']}: {parsed['nfiles']}, "
|
||||
f"{self.category_label['original']}: {pretty_bytes(parsed['original_size'])}, "
|
||||
f"{self.category_label['deduplicated']}: {pretty_bytes(parsed['deduplicated_size'])}, "
|
||||
f"{self.category_label['compressed']}: {pretty_bytes(parsed['compressed_size'])}"
|
||||
)
|
||||
self.app.backup_progress_event.emit(msg)
|
||||
except json.decoder.JSONDecodeError:
|
||||
|
|
Loading…
Reference in a new issue