Add a Swedish interface with a per-person language switch

A small translation system (the English text is its own key, so anything
without a Swedish entry stays English) and a Language switch in the user menu,
saved on the account (users.language) and following the browser when no choice
has been made. Swedish covers the menu, shared parts (search, tables, dialogs,
relative times), the sign-in page and the everyday pages: Dashboard, Alerts,
Servers, Updates, Maintenance, My work, Coming up, To do, Integrations and the
display settings. Server-written messages stay English for now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-12 21:49:49 +01:00
1 parent e7f23ba13f
commit 645816d5a8
168 files changed
+12142 -1422

No files matched your search

+65 -64
View File
@@ -23,6 +23,7 @@ import RecurringMaintenance from "../components/RecurringMaintenance";
import ExportTableButton from "../components/ExportTableButton";
import { EmptyRow, LoadingRow } from "../components/EmptyState";
import PageIntro from "../components/PageIntro";
import { t } from "../i18n";
const DURATIONS: { minutes: number; label: string }[] = [
{ minutes: 30, label: "30 minutes" },
@@ -100,12 +101,12 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
}, []);
async function startBulk(scope: MaintenanceBulkScope) {
const words = DURATIONS.find((d) => d.minutes === minutes)?.label ?? `${minutes} minutes`;
const words = t(DURATIONS.find((d) => d.minutes === minutes)?.label ?? "{n} minutes", { n: minutes });
// Everything is the one choice that can hide a real outage, so it asks first.
if (
scope === "everything" &&
!(await confirmDialog({
title: "Silence everything?",
title: t("Silence everything?"),
message: `This silences every alert about every server, integration and DNS provider for ${words}. Anything still wrong when it ends alerts then.`,
confirmLabel: "Silence everything",
danger: true,
@@ -129,7 +130,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
}
async function endAll() {
if (!(await confirmDialog({ title: "End all maintenance", message: `End all ${windows?.length ?? 0} windows now? Alerts about them become active again.`, confirmLabel: "End all", danger: true }))) return;
if (!(await confirmDialog({ title: t("End all maintenance"), message: `End all ${windows?.length ?? 0} windows now? Alerts about them become active again.`, confirmLabel: "End all", danger: true }))) return;
setError(null);
try {
const res = await api.maintenance.endAll();
@@ -248,7 +249,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
return (
<>
<h2 className="page-title mb-3">Maintenance</h2>
<h2 className="page-title mb-3">{t("Maintenance")}</h2>
<PageIntro>
Silence alerts about one server or integration while you work on it. Every window ends on its own — anything
still wrong when it ends alerts then, so nothing stays hidden.
@@ -258,25 +259,25 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{canEdit && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">Start maintenance</h3>
<h3 className="card-title">{t("Start maintenance")}</h3>
</div>
<form onSubmit={start}>
<div className="card-body row g-3">
<div className="col-md-4">
<label className="form-label">What are you working on?</label>
<label className="form-label">{t("What are you working on?")}</label>
<select className="form-select" required value={target} onChange={(e) => setTarget(e.target.value)}>
<option value="">Choose…</option>
<option value="">{t("Choose…")}</option>
{targets && targets.servers.length + targets.integrations.length + targets.dnsProviders.length + targets.devices.length > 1 && (
<optgroup label="Many at once">
<option value="all:everything">Everything — every server, integration, network device and DNS provider</option>
<optgroup label={t("Many at once")}>
<option value="all:everything">{t("Everything — every server, integration, network device and DNS provider")}</option>
{targets.devices.length > 1 && <option value="all:devices">All network devices ({targets.devices.length})</option>}
{targets.servers.length > 1 && <option value="all:servers">All servers ({targets.servers.length})</option>}
{targets.integrations.length > 1 && <option value="all:integrations">All integrations (the enabled ones)</option>}
{targets.dnsProviders.length > 1 && <option value="all:dns_providers">All DNS providers (the enabled ones)</option>}
{targets.integrations.length > 1 && <option value="all:integrations">{t("All integrations (the enabled ones)")}</option>}
{targets.dnsProviders.length > 1 && <option value="all:dns_providers">{t("All DNS providers (the enabled ones)")}</option>}
</optgroup>
)}
{targets && targets.servers.length > 0 && (
<optgroup label="Servers">
<optgroup label={t("Servers")}>
{targets.servers.map((s) => (
<option key={`s${s.id}`} value={`server:${s.id}`}>
{s.name}
@@ -285,7 +286,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</optgroup>
)}
{targets && targets.integrations.length > 0 && (
<optgroup label="Integrations">
<optgroup label={t("Integrations")}>
{targets.integrations.map((i) => (
<option key={`i${i.id}`} value={`integration:${i.id}`}>
{i.name} ({i.type})
@@ -294,7 +295,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</optgroup>
)}
{targets && targets.devices.length > 0 && (
<optgroup label="Network devices">
<optgroup label={t("Network devices")}>
{targets.devices.map((d) => (
<option key={`n${d.id}`} value={`device:${d.id}`}>
{d.name} ({d.kind.replace("_", " ")})
@@ -303,7 +304,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</optgroup>
)}
{targets && targets.dnsProviders.length > 0 && (
<optgroup label="DNS providers">
<optgroup label={t("DNS providers")}>
{targets.dnsProviders.map((p) => (
<option key={`d${p.id}`} value={`dns_provider:${p.id}`}>
{p.name} ({p.providerType})
@@ -318,13 +319,13 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<select className="form-select" value={minutes} onChange={(e) => setMinutes(Number(e.target.value))}>
{DURATIONS.map((d) => (
<option key={d.minutes} value={d.minutes}>
{d.label}
{t(d.label)}
</option>
))}
</select>
</div>
<div className="col-md-5">
<label className="form-label">Reason (optional)</label>
<label className="form-label">{t("Reason (optional)")}</label>
<input
className="form-control"
maxLength={200}
@@ -341,7 +342,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</div>
<div className="card-footer">
<button type="submit" className="btn btn-primary" disabled={busy || !target}>
{busy ? "Starting…" : "Start maintenance"}
{busy ? t("Starting…") : t("Start maintenance")}
</button>
</div>
</form>
@@ -362,25 +363,25 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{canEdit && kumaIntegrations && kumaIntegrations.length > 0 && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">Import from Uptime Kuma</h3>
<h3 className="card-title">{t("Import from Uptime Kuma")}</h3>
</div>
<form onSubmit={importFromUptimeKuma}>
<div className="card-body row g-3">
<div className="text-secondary">
<strong>Sync schedule</strong> copies Uptime Kuma's maintenance windows — the one running now and the
<strong>{t("Sync schedule")}</strong> copies Uptime Kuma's maintenance windows — the one running now and the
next one of each daily, weekly or one-off window — onto the servers their monitors belong to, so they
show up under Scheduled below and silence alerts when they start. It needs the login username and
password filled in on the integration, and runs by itself every 15 minutes when{" "}
<em>Keep maintenance windows in step</em> is ticked there.
<em>{t("Keep maintenance windows in step")}</em> is ticked there.
</div>
<div className="text-secondary">
<strong>Import now</strong> only looks at what is in maintenance <em>this moment</em>: pick a duration
<strong>{t("Import now")}</strong> only looks at what is in maintenance <em>this moment</em>: pick a duration
— it doesn't have to match Uptime Kuma's own schedule exactly, and importing again later just extends
the window instead of stacking a second one.
</div>
{kumaIntegrations.length > 1 && (
<div className="col-md-5">
<label className="form-label">Uptime Kuma integration</label>
<label className="form-label">{t("Uptime Kuma integration")}</label>
<select
className="form-select"
value={kumaIntegrationId}
@@ -400,7 +401,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<select className="form-select" value={kumaMinutes} onChange={(e) => setKumaMinutes(Number(e.target.value))}>
{DURATIONS.map((d) => (
<option key={d.minutes} value={d.minutes}>
{d.label}
{t(d.label)}
</option>
))}
</select>
@@ -428,7 +429,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{m.unmatched.length > 0 && <span className="text-secondary"> · nothing here for {m.unmatched.join(", ")}</span>}
{m.unmatched.length > 0 && (
<div className="text-secondary small">
Is one of those yours? Add its address under <em>Address aliases</em> below, saying what it belongs to.
Is one of those yours? Add its address under <em>{t("Address aliases")}</em> below, saying what it belongs to.
</div>
)}
<div className="text-secondary small">
@@ -485,13 +486,13 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
)}
<div className="card-footer d-flex align-items-center gap-3">
<button type="button" className="btn btn-primary" onClick={syncFromUptimeKuma} disabled={syncBusy || kumaIntegrationId === ""}>
{syncBusy ? "Syncing…" : "Sync schedule"}
{syncBusy ? t("Syncing…") : t("Sync schedule")}
</button>
<button type="submit" className="btn" disabled={kumaBusy || kumaIntegrationId === ""}>
{kumaBusy ? "Importing…" : "Import now"}
{kumaBusy ? t("Importing…") : t("Import now")}
</button>
{kumaIntegrationId === "" && (
<span className="text-secondary">Every Uptime Kuma integration is disabled — enable one under Integrations.</span>
<span className="text-secondary">{t("Every Uptime Kuma integration is disabled — enable one under Integrations.")}</span>
)}
</div>
</form>
@@ -501,7 +502,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{canEdit && kumaIntegrations && kumaIntegrations.length > 0 && (
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">Address aliases</h3>
<h3 className="card-title">{t("Address aliases")}</h3>
<div className="card-actions">
<ExportTableButton filename="maintenance-aliases" />
</div>
@@ -515,7 +516,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
there. Matching stays exact: only the address you list counts.
</div>
<div className="col-md-4">
<label className="form-label">Address in Uptime Kuma</label>
<label className="form-label">{t("Address in Uptime Kuma")}</label>
<input
className="form-control"
required
@@ -526,11 +527,11 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
/>
</div>
<div className="col-md-5">
<label className="form-label">Belongs to</label>
<label className="form-label">{t("Belongs to")}</label>
<select className="form-select" required value={aliasTarget} onChange={(e) => setAliasTarget(e.target.value)}>
<option value="">Choose…</option>
<option value="">{t("Choose…")}</option>
{targets && targets.servers.length > 0 && (
<optgroup label="Servers">
<optgroup label={t("Servers")}>
{targets.servers.map((s) => (
<option key={`s${s.id}`} value={`server:${s.id}`}>
{s.name}
@@ -539,7 +540,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</optgroup>
)}
{targets && targets.integrations.length > 0 && (
<optgroup label="Integrations">
<optgroup label={t("Integrations")}>
{targets.integrations.map((i) => (
<option key={`i${i.id}`} value={`integration:${i.id}`}>
{i.name} ({i.type})
@@ -548,7 +549,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</optgroup>
)}
{targets && targets.dnsProviders.length > 0 && (
<optgroup label="DNS providers">
<optgroup label={t("DNS providers")}>
{targets.dnsProviders.map((p) => (
<option key={`d${p.id}`} value={`dns_provider:${p.id}`}>
{p.name} ({p.providerType})
@@ -560,7 +561,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</div>
<div className="col-md-3 d-flex align-items-end">
<button type="submit" className="btn btn-primary" disabled={aliasBusy || !aliasTarget || !aliasAddress.trim()}>
{aliasBusy ? "Adding…" : "Add alias"}
{aliasBusy ? t("Adding…") : t("Add alias")}
</button>
</div>
</div>
@@ -576,8 +577,8 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<thead>
<tr>
<th>Address</th>
<th>Belongs to</th>
<th className="w-1">Actions</th>
<th>{t("Belongs to")}</th>
<th className="w-1">{t("Actions")}</th>
</tr>
</thead>
<tbody>
@@ -589,7 +590,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</td>
<td>
<button className="btn btn-sm btn-outline-danger" onClick={() => removeAlias(a)}>
Remove
{t("Remove")}
</button>
</td>
</tr>
@@ -613,11 +614,11 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<table className="table table-vcenter card-table">
<thead>
<tr>
<th>Target</th>
<th>Reason</th>
<th>{t("Target")}</th>
<th>{t("Reason")}</th>
<th>Starts</th>
<th>Ends</th>
{canEdit && <th className="w-1">Actions</th>}
<th>{t("Ends")}</th>
{canEdit && <th className="w-1">{t("Actions")}</th>}
</tr>
</thead>
<tbody>
@@ -635,7 +636,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{canEdit && (
<td>
<button className="btn btn-sm btn-outline-secondary" onClick={() => end(w)}>
Cancel
{t("Cancel")}
</button>
</td>
)}
@@ -653,7 +654,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<div className="card mb-3">
<div className="card-header">
<h3 className="card-title">Active</h3>
<h3 className="card-title">{t("Active")}</h3>
<div className="card-actions">
<ExportTableButton filename="maintenance-active" />
{canEdit && (windows?.length ?? 0) > 1 && (
@@ -667,11 +668,11 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<table className="table table-vcenter card-table">
<thead>
<tr>
<th>Target</th>
<th>Reason</th>
<th>Ends</th>
<th>Started by</th>
{canEdit && <th className="w-1">Actions</th>}
<th>{t("Target")}</th>
<th>{t("Reason")}</th>
<th>{t("Ends")}</th>
<th>{t("Started by")}</th>
{canEdit && <th className="w-1">{t("Actions")}</th>}
</tr>
</thead>
<tbody>
@@ -679,7 +680,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<tr key={w.id}>
<td>
{w.targetName} <span className="text-secondary">· {w.targetKind}</span>
{w.source?.startsWith("kuma:") && <span className="badge bg-cyan-lt ms-2">Uptime Kuma</span>}
{w.source?.startsWith("kuma:") && <span className="badge bg-cyan-lt ms-2">{t("Uptime Kuma")}</span>}
</td>
<td className="text-secondary">{w.reason ?? "—"}</td>
<td data-csv={w.endsAt}>
@@ -690,7 +691,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
{canEdit && (
<td>
<button className="btn btn-sm btn-outline-secondary" onClick={() => end(w)}>
End now
{t("End now")}
</button>
</td>
)}
@@ -698,7 +699,7 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
))}
{windows === null && <LoadingRow colSpan={canEdit ? 5 : 4} />}
{windows?.length === 0 && (
<EmptyRow colSpan={canEdit ? 5 : 4} title="Nothing is in maintenance" hint="Every alert is live. Start a window above before you work on something, so it doesn't raise alarms while you do." />
<EmptyRow colSpan={canEdit ? 5 : 4} title={t("Nothing is in maintenance")} hint={t("Every alert is live. Start a window above before you work on something, so it doesn't raise alarms while you do.")} />
)}
</tbody>
</table>
@@ -707,18 +708,18 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
<div className="card">
<div className="card-header">
<h3 className="card-title">What gets silenced</h3>
<h3 className="card-title">{t("What gets silenced")}</h3>
</div>
<div className="card-body">
<div className="row">
<div className="col-md-6">
<div className="fw-bold mb-1">Silenced for the target</div>
<div className="fw-bold mb-1">{t("Silenced for the target")}</div>
<ul className="text-secondary">
<li>Server offline and disk-full alerts (for a server).</li>
<li>Storage, volume and disk-health alerts (for a Proxmox or Synology integration).</li>
<li>Backup-failure and uncovered-guest alerts (for a Proxmox integration).</li>
<li>Backup-verification-failure alerts (for a Proxmox Backup Server integration).</li>
<li>Failed-run alerts for the Semaphore or Gitea integration you choose.</li>
<li>{t("Server offline and disk-full alerts (for a server).")}</li>
<li>{t("Storage, volume and disk-health alerts (for a Proxmox or Synology integration).")}</li>
<li>{t("Backup-failure and uncovered-guest alerts (for a Proxmox integration).")}</li>
<li>{t("Backup-verification-failure alerts (for a Proxmox Backup Server integration).")}</li>
<li>{t("Failed-run alerts for the Semaphore or Gitea integration you choose.")}</li>
<li>
"Integration down" alerts for that <em>type</em> of service — these are tracked per type (e.g. all
Proxmox), not per instance, so with two Proxmox integrations a failure on the other one is silenced
@@ -727,12 +728,12 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
</ul>
</div>
<div className="col-md-6">
<div className="fw-bold mb-1">Not silenced</div>
<div className="fw-bold mb-1">{t("Not silenced")}</div>
<ul className="text-secondary">
<li>Secret and certificate expiry, Tailscale key expiry, Docker update reminders.</li>
<li>DNS record change notifications.</li>
<li>{t("Secret and certificate expiry, Tailscale key expiry, Docker update reminders.")}</li>
<li>{t("DNS record change notifications.")}</li>
</ul>
<div className="fw-bold mb-1">When a window ends</div>
<div className="fw-bold mb-1">{t("When a window ends")}</div>
<div className="text-secondary">
A problem that started during it and is still there alerts on the next check (within 15 minutes). One
that was already alerted before it began and has since cleared is reported as cleared; one that