fix(storage): translate disk passthrough completion messages as a whole

This commit is contained in:
martino
2026-09-22 19:59:31 +02:00
parent f3a2b70219
commit 4322ae517b
3 changed files with 115 additions and 2 deletions
+7 -1
View File
@@ -443,7 +443,13 @@ done
echo ""
if [ "$DISKS_ADDED" -gt 0 ]; then
msg_ok "$(translate "Completed.") $DISKS_ADDED $(translate "disk(s) added to VM") $VMID."
COMPLETED_MESSAGE="$(translate "Completed. Disks added to VM {vmid}: {count}.")"
if [[ "$COMPLETED_MESSAGE" != *'{vmid}'* || "$COMPLETED_MESSAGE" != *'{count}'* ]]; then
COMPLETED_MESSAGE="Completed. Disks added to VM {vmid}: {count}."
fi
COMPLETED_MESSAGE="${COMPLETED_MESSAGE//\{vmid\}/$VMID}"
COMPLETED_MESSAGE="${COMPLETED_MESSAGE//\{count\}/$DISKS_ADDED}"
msg_ok "$COMPLETED_MESSAGE"
else
msg_warn "$(translate "No disks were added.")"
fi
+7 -1
View File
@@ -713,7 +713,13 @@ done
echo ""
if [ "$DISKS_ADDED" -gt 0 ]; then
msg_ok "$(translate "Completed.") $DISKS_ADDED $(translate "disk(s) added to CT") $CTID."
COMPLETED_MESSAGE="$(translate "Completed. Disks added to CT {ctid}: {count}.")"
if [[ "$COMPLETED_MESSAGE" != *'{ctid}'* || "$COMPLETED_MESSAGE" != *'{count}'* ]]; then
COMPLETED_MESSAGE="Completed. Disks added to CT {ctid}: {count}."
fi
COMPLETED_MESSAGE="${COMPLETED_MESSAGE//\{ctid\}/$CTID}"
COMPLETED_MESSAGE="${COMPLETED_MESSAGE//\{count\}/$DISKS_ADDED}"
msg_ok "$COMPLETED_MESSAGE"
else
msg_warn "$(translate "No disks were added.")"
fi