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

+9 -8
View File
@@ -1,6 +1,7 @@
import { useEffect, useState, type ReactNode } from "react";
import { api } from "../api/client";
import DetailDrawer from "./DetailDrawer";
import { t } from "../i18n";
/** The little forms behind the bulk bar: each says what will be done and to how many, collects the one or two answers it needs, and hands them back. */
@@ -19,7 +20,7 @@ function Shell({ title, subtitle, onClose, onSubmit, submitLabel, busy, disabled
{busy ? "Working…" : submitLabel}
</button>
<button type="button" className="btn" onClick={onClose}>
Cancel
{t("Cancel")}
</button>
</div>
<div className="text-secondary small mt-2">Afterwards there is an Undo button for a little while; it puts back what was changed.</div>
@@ -68,7 +69,7 @@ export function SilenceBulkDrawer({ noun, count, canSilenceDependents, onSubmit,
))}
</select>
<label className="form-label" htmlFor="bulk-reason">
Why <span className="text-secondary">(optional)</span>
Why <span className="text-secondary">{t("(optional)")}</span>
</label>
<input id="bulk-reason" className="form-control mb-3" maxLength={200} value={reason} onChange={(e) => setReason(e.target.value)} placeholder="e.g. Firmware update" />
{canSilenceDependents && (
@@ -122,14 +123,14 @@ export function AckBulkDrawer({ count, onSubmit, onClose }: { count: number; onS
>
<p className="text-secondary">Says that somebody has seen them. The alerts stay, and are still counted by /metrics, but they are no longer ones nobody has looked at. One that was already acknowledged has its note replaced.</p>
<label className="form-label" htmlFor="bulk-note">
Note <span className="text-secondary">(optional)</span>
Note <span className="text-secondary">{t("(optional)")}</span>
</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
</label>
<select id="bulk-assignee" className="form-select mb-3" value={assignee} onChange={(e) => setAssignee(e.target.value)}>
<option value="">Nobody in particular</option>
<option value="">{t("Nobody in particular")}</option>
{people.map((p) => (
<option key={p.id} value={p.id}>
{p.name}
@@ -157,7 +158,7 @@ export function TagBulkDrawer({ count, tags, onSubmit, onClose }: { count: numbe
const [busy, setBusy] = useState(false);
return (
<Shell
title="Tags"
title={t("Tags")}
subtitle={`${count} server${count === 1 ? "" : "s"}`}
onClose={onClose}
busy={busy}
@@ -197,7 +198,7 @@ export function RunsOnBulkDrawer({ count, servers, onSubmit, onClose }: { count:
const [busy, setBusy] = useState(false);
return (
<Shell
title="Runs on"
title={t("Runs on")}
subtitle={`${count} server${count === 1 ? "" : "s"}`}
onClose={onClose}
busy={busy}
@@ -214,7 +215,7 @@ export function RunsOnBulkDrawer({ count, servers, onSubmit, onClose }: { count:
They run on
</label>
<select id="bulk-parent" className="form-select" value={choice} onChange={(e) => setChoice(e.target.value)}>
<option value="">Choose…</option>
<option value="">{t("Choose…")}</option>
<option value="auto">Work it out from the Proxmox node (the default)</option>
{servers.map((s) => (
<option key={s.id} value={s.id}>
@@ -239,7 +240,7 @@ function FieldChange({ id, label, type, value, onChange }: { id: string; label:
<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="clear">Clear</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 />}
</div>