From 0b39dc8a97192a18dfa80c39851f203106b94e17 Mon Sep 17 00:00:00 2001 From: Janlhin <72262030+Janlhin@users.noreply.github.com> Date: Sun, 8 Nov 2026 04:31:59 +0800 Subject: [PATCH 1/2] i18n: finish the two app strings left over from #145 The boot label was still hardcoded even though app.startingOpenSave was already in the catalogs, and app.detailsSaved was still English in zh-Hans and zh-Hant. Both were pointed out in the #145 merge review. Only the reference and the two values change; key sets stay aligned with en.json. --- cmd/opensave-app/frontend/src/App.svelte | 2 +- cmd/opensave-app/frontend/src/locales/zh-Hans.json | 2 +- cmd/opensave-app/frontend/src/locales/zh-Hant.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/opensave-app/frontend/src/App.svelte b/cmd/opensave-app/frontend/src/App.svelte index f235ff9d..3b1251b1 100644 --- a/cmd/opensave-app/frontend/src/App.svelte +++ b/cmd/opensave-app/frontend/src/App.svelte @@ -290,7 +290,7 @@ {:else}
AppData often has nothing to work
- it out from, so you can set it here.
+ {$t('game.appId.moreInfo1')}AppData{$t('game.appId.moreInfo2')}
store.steampowered.com/app/1091500/… — not the one
- from another store.
+ {$t('game.appId.unknown1')}
+ store.steampowered.com/app/1091500/…{$t('game.appId.unknown2')}
{:else if check?.state === 'unreachable'}
- Couldn't reach Steam to check this number. If Steam's store or CDN is blocked on
- this network, cover art won't load here either — the ID itself may well be right.
+ {$t('game.appId.unreachable')}
{/if}
- Switching branches snapshots your current save first, then restores the other branch's latest - state. A branch you just created has no state of its own yet, so it starts from whatever is in - your save folder now — the two diverge from the first snapshot you take on it. + {$t('game.branches.footnote')}
{#if dialogOpen} diff --git a/cmd/opensave-app/frontend/src/views/game/CloudTab.svelte b/cmd/opensave-app/frontend/src/views/game/CloudTab.svelte index 129cb804..5804158d 100644 --- a/cmd/opensave-app/frontend/src/views/game/CloudTab.svelte +++ b/cmd/opensave-app/frontend/src/views/game/CloudTab.svelte @@ -4,6 +4,7 @@ import { navigate, toast, askConfirm, settings } from '../../lib/stores.js'; import { api } from '../../lib/api.js'; import { fmtSize } from '../../lib/format.js'; + import { t } from '../../lib/i18n.js'; import Spinner from '../../components/ui/Spinner.svelte'; import Cloud from 'lucide-svelte/icons/cloud'; import RefreshCw from 'lucide-svelte/icons/refresh-cw'; @@ -31,16 +32,16 @@ load(); const restore = async (snap) => { - if (!(await askConfirm(`Download and restore cloud snapshot ${snap.snapshotId} over your current save?`, { title: 'Restore from cloud?', confirmText: 'Download & restore' }))) return; - return run('Restored from cloud', async () => { + if (!(await askConfirm($t('game.cloud.restoreConfirm', { id: snap.snapshotId }), { title: $t('game.cloud.restoreTitle'), confirmText: $t('game.cloud.downloadRestore') }))) return; + return run($t('game.cloud.restored'), async () => { await api.post(`/api/cloud/restore/${game.id}`, { fileName: snap.name }); }); }; const upload = () => - run('Uploaded to cloud', async () => { + run($t('game.cloud.uploaded'), async () => { const res = await api.post(`/api/cloud/sync-local/${game.id}`); - toast(`Uploaded ${res.uploaded}, skipped ${res.skipped}`, 'success'); + toast($t('game.cloud.uploadResult', { uploaded: res.uploaded, skipped: res.skipped }), 'success'); await load(); }); @@ -48,33 +49,32 @@Snapshots backed up to your configured cloud provider.
+{$t('game.cloud.sub')}
No cloud snapshots for this game yet.
+{$t('game.cloud.empty')}
{#if $settings?.cloudSync?.ready} -New snapshots are copied up as they are taken. “Upload local snapshots” sends the ones from before.
+{$t('game.cloud.readyHint')}
{:else}- Set up a provider in , - then use “Upload local snapshots”. + {$t('game.cloud.setupHint1')}{$t('game.cloud.setupHint2')}
{/if}| Branch | Date | Size | |
|---|---|---|---|
| {$t('game.cloud.colBranch')} | {$t('game.cloud.colDate')} | {$t('game.cloud.colSize')} | {new Date(snap.createdTime).toLocaleString()} | {fmtSize(snap.sizeBytes)} | - + | {/each} diff --git a/cmd/opensave-app/frontend/src/views/game/CompareDialog.svelte b/cmd/opensave-app/frontend/src/views/game/CompareDialog.svelte index 75457336..73113dd6 100644 --- a/cmd/opensave-app/frontend/src/views/game/CompareDialog.svelte +++ b/cmd/opensave-app/frontend/src/views/game/CompareDialog.svelte @@ -11,6 +11,7 @@ import { api } from '../../lib/api.js'; import { fmtSize } from '../../lib/format.js'; import { snapshotKind, whenLabel } from '../../lib/snapshots.js'; + import { t } from '../../lib/i18n.js'; export let game; /** Every snapshot of the game, newest first. */ @@ -46,18 +47,18 @@ c.change === 'changed' ? `${fmtSize(c.fromSize)} → ${fmtSize(c.toSize)}` : fmtSize(c.change === 'added' ? c.toSize : c.fromSize); -