feat(i18n): convert Settings storage section to t() (Batch E)

This commit is contained in:
iamdoubz committed 2026-07-12 12:29:25 -05:00
1 parent b295e1ee83
commit 12388b8bd9
1 file changed
+27 -26
+27 -26
View File
@@ -526,14 +526,17 @@
let ioError = $state(false);
async function exportAllMeetings() {
const dir = await open({ directory: true, title: "Export all meetings into…" });
const dir = await open({ directory: true, title: t("settings.storage.export_dialog_title") });
if (typeof dir !== "string") return;
exportBusy = true;
ioStatus = null;
ioError = false;
try {
const n = await api.bulkExportMeetings(dir, "bundle");
ioStatus = `Exported ${n} meeting${n === 1 ? "" : "s"}.`;
ioStatus =
n === 1
? t("settings.storage.exported_one", { n })
: t("settings.storage.exported_many", { n });
} catch (e) {
ioStatus = errorMessage(e);
ioError = true;
@@ -543,7 +546,7 @@
}
async function importMeetings() {
const dir = await open({ directory: true, title: "Import a bundle (or a folder of bundles)…" });
const dir = await open({ directory: true, title: t("settings.storage.import_dialog_title") });
if (typeof dir !== "string") return;
importBusy = true;
ioStatus = null;
@@ -551,7 +554,10 @@
try {
const n = await api.importMeetingBundle(dir);
await meetings.load();
ioStatus = `Imported ${n} meeting${n === 1 ? "" : "s"}.`;
ioStatus =
n === 1
? t("settings.storage.imported_one", { n })
: t("settings.storage.imported_many", { n });
} catch (e) {
ioStatus = errorMessage(e);
ioError = true;
@@ -1069,53 +1075,48 @@
</section>
{:else if section === "storage"}
<section>
<h3>Storage</h3>
<div class="row">Location<code>{settings.settings.storage_root}</code></div>
<p class="muted">
Changing the storage location isn't supported yet — this is where meetings, models, and
the database currently live.
</p>
<h4>Retention</h4>
<p class="muted">
Automatically delete the oldest meetings past a limit. Checked once at startup; empty
means no limit. Never touches a meeting that's currently recording.
</p>
<h3>{t("settings.storage.title")}</h3>
<div class="row">
{t("settings.storage.location_label")}<code>{settings.settings.storage_root}</code>
</div>
<p class="muted">{t("settings.storage.location_hint")}</p>
<h4>{t("settings.storage.retention_title")}</h4>
<p class="muted">{t("settings.storage.retention_hint")}</p>
<div class="grid">
<label
>Max age (days)<input
>{t("settings.storage.max_age")}<input
type="number"
min="1"
placeholder="no limit"
placeholder={t("settings.storage.no_limit")}
bind:value={maxAgeInput}
onchange={saveRetention}
/></label
>
<label
>Max size (GB)<input
>{t("settings.storage.max_size")}<input
type="number"
min="1"
placeholder="no limit"
placeholder={t("settings.storage.no_limit")}
bind:value={maxSizeInput}
onchange={saveRetention}
/></label
>
</div>
<h4>Export &amp; import</h4>
<h4>{t("settings.storage.export_import_title")}</h4>
<p class="muted">
Move recordings between computers as portable bundle folders (audio, transcript, notes,
summary, and a <code>meeting.json</code> manifest). Export to any folder — a synced drive, a
USB stick, or a sync target's local mount — then import it on the other machine. Imported meetings
get a fresh id, so re-importing never overwrites anything.
{t("settings.storage.export_hint_1")}
<code>meeting.json</code>
{t("settings.storage.export_hint_2")}
</p>
<div class="row btns">
<button onclick={exportAllMeetings} disabled={exportBusy}>
<FolderOutput size={14} aria-hidden="true" />
{exportBusy ? "Exporting…" : "Export all meetings…"}
{exportBusy ? t("settings.storage.exporting") : t("settings.storage.export_all")}
</button>
<button onclick={importMeetings} disabled={importBusy}>
<FolderInput size={14} aria-hidden="true" />
{importBusy ? "Importing…" : "Import meetings…"}
{importBusy ? t("settings.storage.importing") : t("settings.storage.import_all")}
</button>
</div>
{#if ioStatus}