fix(backup): use complete messages for archives and destinations

This commit is contained in:
martino
2026-09-21 19:49:43 +02:00
parent 704eb3f9fb
commit 6a7ffad9b8
6 changed files with 185 additions and 3 deletions
+3 -3
View File
@@ -1300,7 +1300,7 @@ export function HostBackup() {
</div>
) : unifiedArchives.length === 0 ? (
<div className="text-sm text-muted-foreground py-4">
{t("backup.archives.emptyBefore")} <span className="font-medium">{t("backup.manual.run")}</span> {t("backup.archives.emptyAfter")}
{t("backup.archives.emptyMessage")}
</div>
) : (
<div className="space-y-2">
@@ -4089,7 +4089,7 @@ function CreateJobDialog({
className="font-mono"
/>
<p className="text-xs text-muted-foreground">
{t("backup.destinations.localAttachHelpBefore")} <code className="font-mono">/dump</code> {t("backup.destinations.localAttachHelpMiddle")} <code className="font-mono">/var/lib/vz/dump</code>.
{t("backup.destinations.localAttachHelpMessage")}
</p>
</>
) : (
@@ -5709,7 +5709,7 @@ function DestinationsSection({
)}
{backups > 0 && (
<div className="px-3 py-2 rounded-md border border-blue-500/40 bg-blue-500/5">
{t("backup.destinations.backupsKeptBefore", { count: backups })} <span className="font-medium">{t("backup.destinations.kept")}</span>.
{t("backup.destinations.backupsKeptMessage")}
</div>
)}
</div>
+18
View File
@@ -7,4 +7,22 @@ The ProxMenux Monitor dashboard uses a small client-side i18n layer.
To improve a translation, edit the values in your locale's `common.json` — keep placeholders such as `{uptime}`, `{vmid}` or `{count}` unchanged, and don't translate brand or product names (`ProxMenux Monitor`, `Proxmox Backup Server`, `Secure Gateway`, `Tailscale`, etc.). Missing keys fall back to English at runtime, so a partial refresh is always safe to merge.
## Backup message composition regressions
From the repository root, run:
```sh
node tests/test_backup_archives_empty.cjs
node tests/test_backup_destination_messages.cjs
```
Prerequisites: Node.js and the `typescript` development dependency from
`AppImage/package.json` must be installed/resolvable (normally in
`AppImage/node_modules`). These tests compile actual JSX message branches and
pure i18n lookup functions without importing the component or calling a backend.
They cover whole English messages, missing-key locale fallback, loading/error
branches, nonempty lists, the removal notice at zero/one/multiple archives,
local-attach help, and unchanged shared labels. They do not replace browser or
real-host acceptance. Keep literal paths in the local-attach help unchanged.
To add a new locale, see [§11 → Adding a new locale](../../CONTRIBUTING.md#adding-a-new-locale) in the Contributing Guide.
+3
View File
@@ -3828,6 +3828,7 @@
"downloadTitle": "Download this backup",
"emptyAfter": "backups yet.",
"emptyBefore": "No",
"emptyMessage": "No backup archives found.",
"encrypted": "Encrypted",
"encryptedTitle": "This backup is encrypted",
"filesInBackup": "Files in backup",
@@ -3903,6 +3904,7 @@
"addPbsRepository": "Add PBS repository",
"appendAuthorizedKeyBefore": "Append the generated public key to",
"backupsKeptBefore": "Existing backups are kept in",
"backupsKeptMessage": "Existing backup archives are not deleted.",
"borgEncryptionInherited": "Borg encryption is controlled by the repository.",
"builtIn": "Built-in",
"builtInDefault": "Built-in default",
@@ -3923,6 +3925,7 @@
"leavePassphraseBlank": "Leave blank to keep the saved passphrase.",
"leavePasswordBlank": "Leave blank to keep the saved password.",
"localAttachHelpBefore": "Use a mounted local path. For USB drives, mount them first in",
"localAttachHelpMessage": "Mount USB drives first. Leave blank to use the PVE storage path + /dump (fallback: /var/lib/vz/dump).",
"localAttachHelpMiddle": "USB drives",
"localManualPickHelp": "Pick a local path for one-shot backup output.",
"localPathHelpAfter": "or another mounted path.",