Swedish interface: labels and short texts across every page

About 1,600 more headings, buttons, table columns, status words, placeholders and short messages are translated. Tables of words built when the app loads are now read when they are drawn, so they follow the language, and a test fails if text is translated at load time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-16 20:16:39 +01:00
1 parent 25183c0320
commit 6e39430a1f
173 files changed
+3922 -2245

No files matched your search

+18 -18
View File
@@ -17,7 +17,7 @@ function Shell({ title, subtitle, onClose, onSubmit, submitLabel, busy, disabled
{children}
<div className="d-flex gap-2 mt-3">
<button type="submit" className="btn btn-primary" disabled={busy || disabled}>
{busy ? "Working…" : submitLabel}
{busy ? t("Working…") : submitLabel}
</button>
<button type="button" className="btn" onClick={onClose}>
{t("Cancel")}
@@ -46,7 +46,7 @@ export function SilenceBulkDrawer({ noun, count, canSilenceDependents, onSubmit,
const [busy, setBusy] = useState(false);
return (
<Shell
title="Put under maintenance"
title={t("Put under maintenance")}
subtitle={`${count} ${noun}`}
onClose={onClose}
busy={busy}
@@ -59,7 +59,7 @@ export function SilenceBulkDrawer({ noun, count, canSilenceDependents, onSubmit,
>
<p className="text-secondary">Alerts about each are held back for this long; anything still wrong when it ends alerts then. One already under maintenance has its time restarted.</p>
<label className="form-label" htmlFor="bulk-min">
For
{t("For")}
</label>
<select id="bulk-min" className="form-select mb-3" value={minutes} onChange={(e) => setMinutes(Number(e.target.value))}>
{MINUTES.map((m) => (
@@ -83,7 +83,7 @@ export function SilenceBulkDrawer({ noun, count, canSilenceDependents, onSubmit,
}
const LENGTHS: { hours: number | null; label: string }[] = [
{ hours: null, label: "Until the alert is gone" },
{ hours: null, get label() { return t("Until the alert is gone"); } },
{ hours: 1, label: "1 hour" },
{ hours: 4, label: "4 hours" },
{ hours: 24, label: "1 day" },
@@ -110,7 +110,7 @@ export function AckBulkDrawer({ count, onSubmit, onClose }: { count: number; onS
}, []);
return (
<Shell
title="Acknowledge"
title={t("Acknowledge")}
subtitle={`${count} alert${count === 1 ? "" : "s"}`}
onClose={onClose}
busy={busy}
@@ -127,7 +127,7 @@ export function AckBulkDrawer({ count, onSubmit, onClose }: { count: number; onS
</label>
<textarea id="bulk-note" className="form-control mb-3" rows={3} maxLength={500} value={note} onChange={(e) => setNote(e.target.value)} placeholder="e.g. The UPS is being swapped on Saturday" />
<label className="form-label" htmlFor="bulk-assignee">
Who has them
{t("Who has them")}
</label>
<select id="bulk-assignee" className="form-select mb-3" value={assignee} onChange={(e) => setAssignee(e.target.value)}>
<option value="">{t("Nobody in particular")}</option>
@@ -138,7 +138,7 @@ export function AckBulkDrawer({ count, onSubmit, onClose }: { count: number; onS
))}
</select>
<label className="form-label" htmlFor="bulk-hours">
For how long
{t("For how long")}
</label>
<select id="bulk-hours" className="form-select" value={hours} onChange={(e) => setHours(e.target.value)}>
{LENGTHS.map((l) => (
@@ -163,7 +163,7 @@ export function TagBulkDrawer({ count, tags, onSubmit, onClose }: { count: numbe
onClose={onClose}
busy={busy}
disabled={tag.trim() === ""}
submitLabel={mode === "add" ? "Add the tag" : "Take the tag off"}
submitLabel={mode === "add" ? t("Add the tag") : t("Take the tag off")}
onSubmit={async () => {
setBusy(true);
await onSubmit({ mode, tag: tag.trim() });
@@ -172,14 +172,14 @@ export function TagBulkDrawer({ count, tags, onSubmit, onClose }: { count: numbe
>
<div className="btn-group mb-3" role="group" aria-label="Add or take off">
<button type="button" className={`btn ${mode === "add" ? "btn-primary" : "btn-outline-secondary"}`} aria-pressed={mode === "add"} onClick={() => setMode("add")}>
Add a tag
{t("Add a tag")}
</button>
<button type="button" className={`btn ${mode === "remove" ? "btn-primary" : "btn-outline-secondary"}`} aria-pressed={mode === "remove"} onClick={() => setMode("remove")}>
Take a tag off
{t("Take a tag off")}
</button>
</div>
<label className="form-label" htmlFor="bulk-tag">
Tag
{t("Tag")}
</label>
<input id="bulk-tag" className="form-control" list="bulk-tags" maxLength={30} value={tag} onChange={(e) => setTag(e.target.value)} placeholder="e.g. lab" autoFocus />
<datalist id="bulk-tags">
@@ -212,7 +212,7 @@ export function RunsOnBulkDrawer({ count, servers, onSubmit, onClose }: { count:
>
<p className="text-secondary">When the server they run on is down, their own offline alerts are folded under its alert instead of adding to the noise. A change that would make a loop is left out.</p>
<label className="form-label" htmlFor="bulk-parent">
They run on
{t("They run on")}
</label>
<select id="bulk-parent" className="form-select" value={choice} onChange={(e) => setChoice(e.target.value)}>
<option value="">{t("Choose…")}</option>
@@ -238,8 +238,8 @@ function FieldChange({ id, label, type, value, onChange }: { id: string; label:
</label>
<div className="d-flex gap-2">
<select aria-label={`${label}: what to do`} className="form-select w-auto" value={value.mode} onChange={(e) => onChange({ ...value, mode: e.target.value as Field["mode"] })}>
<option value="keep">Leave as it is</option>
<option value="set">Set to…</option>
<option value="keep">{t("Leave as it is")}</option>
<option value="set">{t("Set to…")}</option>
<option value="clear">{t("Clear")}</option>
</select>
{value.mode === "set" && <input id={id} type={type} className="form-control" maxLength={120} value={value.value} onChange={(e) => onChange({ ...value, value: e.target.value })} required />}
@@ -258,7 +258,7 @@ export function HardwareBulkDrawer({ count, onSubmit, onClose }: { count: number
const nothing = location.mode === "keep" && warranty.mode === "keep" && support.mode === "keep";
return (
<Shell
title="Change hardware"
title={t("Change hardware")}
subtitle={`${count} piece${count === 1 ? "" : "s"}`}
onClose={onClose}
busy={busy}
@@ -278,9 +278,9 @@ export function HardwareBulkDrawer({ count, onSubmit, onClose }: { count: number
}}
>
<p className="text-secondary">Whatever is left as it is stays the way each one has it.</p>
<FieldChange id="bulk-location" label="Where it is" type="text" value={location} onChange={setLocation} />
<FieldChange id="bulk-warranty" label="Warranty until" type="date" value={warranty} onChange={setWarranty} />
<FieldChange id="bulk-support" label="End of support" type="date" value={support} onChange={setSupport} />
<FieldChange id="bulk-location" label={t("Where it is")} type="text" value={location} onChange={setLocation} />
<FieldChange id="bulk-warranty" label={t("Warranty until")} type="date" value={warranty} onChange={setWarranty} />
<FieldChange id="bulk-support" label={t("End of support")} type="date" value={support} onChange={setSupport} />
</Shell>
);
}