)}
@@ -455,7 +456,7 @@ export default function ServerPorts({
setFilter(e.target.value)}
/>
@@ -475,10 +476,10 @@ export default function ServerPorts({
@@ -500,8 +501,8 @@ export default function ServerPorts({
{p.isNew && (
-
)}
{visible && visible.length === 0 && data && data.ports.length > 0 && (
- Nothing matches that filter.
+ {t("Nothing matches that filter.")}
)}
diff --git a/web/src/components/ServerStatusStrip.tsx b/web/src/components/ServerStatusStrip.tsx
index 6184db5..c0328ea 100644
--- a/web/src/components/ServerStatusStrip.tsx
+++ b/web/src/components/ServerStatusStrip.tsx
@@ -1,6 +1,7 @@
import { Link } from "react-router-dom";
import type { AlertItem, HealthCheckSettings, MaintenanceWindow, ServerHardware, ServerRecord } from "../api/client";
import { serverStrip, type StripTile, type StripTone } from "../utils/serverStrip";
+import { t } from "../i18n";
const TEXT: Record = { ok: "text-green", warn: "text-yellow", bad: "text-red", info: "text-blue", muted: "" };
@@ -36,7 +37,7 @@ function Tile({ t }: { t: StripTile }) {
export default function ServerStatusStrip({ server, hardware, defaults, alerts, windows }: { server: ServerRecord; hardware: ServerHardware; defaults: HealthCheckSettings; alerts: AlertItem[] | null; windows: MaintenanceWindow[] | null }) {
const tiles = serverStrip({ server, hardware, defaults, alerts, windows });
return (
-
+
{tiles.map((t) => (
))}
diff --git a/web/src/components/ServerTags.tsx b/web/src/components/ServerTags.tsx
index bae6740..9b10c0d 100644
--- a/web/src/components/ServerTags.tsx
+++ b/web/src/components/ServerTags.tsx
@@ -4,6 +4,7 @@ import { api } from "../api/client";
import { normalizeTagInput, tagBadge, useTagColors } from "../utils/tags";
import { readableError } from "../utils/errors";
import { ErrorNotice } from "./Notice";
+import { t } from "../i18n";
export function TagBadges({ tags, linked = false }: { tags: string[]; linked?: boolean }) {
const colors = useTagColors();
@@ -101,7 +102,7 @@ export default function ServerTags({
-
+
{draftTags.map((tag) => {
const { className, style } = tagBadge(tag, colors);
@@ -118,13 +119,13 @@ export default function ServerTags({
);
})}
- {draftTags.length === 0 && No tags yet.}
+ {draftTags.length === 0 && {t("No tags yet.")}}
- Save
+ {t("Save")}
setEditing(false)} disabled={saving}>
- Cancel
+ {t("Cancel")}
{suggestions.some((s) => !draftTags.includes(s)) && (
- Add:
+ {t("Add:")}
{suggestions
.filter((s) => !draftTags.includes(s))
.slice(0, 30)
@@ -168,7 +169,7 @@ export default function ServerTags({
})}
)}
- Lowercase letters, numbers and - _ . : / — up to 12 tags per server.
+ {t("Lowercase letters, numbers and - _ . : / — up to 12 tags per server.")}
);
diff --git a/web/src/components/ServerTaskTable.tsx b/web/src/components/ServerTaskTable.tsx
index a618879..b9ed4f3 100644
--- a/web/src/components/ServerTaskTable.tsx
+++ b/web/src/components/ServerTaskTable.tsx
@@ -6,6 +6,7 @@ import { formatDateTime, is24HourFormat } from "../utils/date";
import { sortItems, type SortDirection } from "../hooks/useSortable";
import SortableTh from "./SortableTh";
import { downloadCsv } from "../utils/csv";
+import { t } from "../i18n";
export const SCHEDULE_TYPE_LABELS: Record = {
cron: "Cron jobs",
@@ -97,7 +98,7 @@ export default function ServerTaskTable({
{tasks.length > 0 && (
- Export CSV
+ {t("Export CSV")}
)}
@@ -110,7 +111,7 @@ export default function ServerTaskTable({
- label="Name" sortKeyName="name" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
+ label={t("Name")} sortKeyName="name" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
label="Command"
sortKeyName="command"
@@ -126,20 +127,20 @@ export default function ServerTaskTable({
onSort={requestSort}
/>
- label="Next run"
+ label={t("Next run")}
sortKeyName="nextRunAt"
activeKey={sortKey}
direction={sortDir}
onSort={requestSort}
/>
- label="Status"
+ label={t("Status")}
sortKeyName="enabled"
activeKey={sortKey}
direction={sortDir}
onSort={requestSort}
/>
- {canEditTasks && | Actions | }
+ {canEditTasks && {t("Actions")} | }
@@ -173,9 +174,9 @@ export default function ServerTaskTable({
{task.isStale ? (
Missing
) : task.enabled ? (
- Enabled
+ {t("Enabled")}
) : (
- Disabled
+ {t("Disabled")}
)}
{task.origin === "manual" && Manual}
@@ -184,10 +185,10 @@ export default function ServerTaskTable({
{task.origin === "manual" && (
onEdit(task)}>
- Edit
+ {t("Edit")}
onDelete(task)}>
- Delete
+ {t("Delete")}
)}
diff --git a/web/src/components/ServerThresholds.tsx b/web/src/components/ServerThresholds.tsx
index e7f5b0e..27a9dad 100644
--- a/web/src/components/ServerThresholds.tsx
+++ b/web/src/components/ServerThresholds.tsx
@@ -3,6 +3,7 @@ import { api, type HealthCheckSettings, type ServerRecord, type ServerThresholds
import { readableError } from "../utils/errors";
import { toast } from "../utils/toast";
import { ErrorNotice } from "./Notice";
+import { t } from "../i18n";
type Field = "serverOfflineMinutes" | "diskUsagePercent" | "diskForecastDays" | "backupStaleHours";
@@ -77,10 +78,10 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
return (
- Alert limits
+ {t("Alert limits")}
- This server has limits of its own; everything else follows Settings.
+ {t("This server has limits of its own; everything else follows Settings.")}
{FIELDS.filter((f) => own?.[f.key] !== undefined).map((f) => (
-
@@ -101,7 +102,7 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
return (
- Alert limits
+ {t("Alert limits")}
{has(own) && (
its own limits
@@ -115,7 +116,7 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
}}
>
- Leave a box empty to follow Settings → Notifications (shown inside the box). Only what you fill in is different for this server.
+ {t("Leave a box empty to follow Settings → Notifications (shown inside the box). Only what you fill in is different for this server.")}
{FIELDS.filter((f) => !f.onlyForGuests || isGuest || own?.[f.key] !== undefined).map((f) => (
@@ -146,8 +147,8 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
| Disk |
- Alert at (%) |
- Leave it alone |
+ {t("Alert at (%)")} |
+ {t("Leave it alone")} |
@@ -198,7 +199,7 @@ export default function ServerThresholds({ server, defaults, disks, canEdit, onC
{has(own) && (
void save(own?.ignoreServices?.length ? { ignoreServices: own.ignoreServices } : null)}>
- Follow Settings again
+ {t("Follow Settings again")}
)}
diff --git a/web/src/components/ServerTrends.tsx b/web/src/components/ServerTrends.tsx
index 08d2586..b561b3c 100644
--- a/web/src/components/ServerTrends.tsx
+++ b/web/src/components/ServerTrends.tsx
@@ -5,6 +5,7 @@ import TimeChart from "./TimeChart";
import RangeSelect from "./RangeSelect";
import { BlockSkeleton } from "./Skeleton";
import { CHART_RANGES, useChartRange } from "../utils/chartRanges";
+import { t } from "../i18n";
function levelColor(series: ServerMetricSeries): string {
const v = series.latest ?? 0;
@@ -98,12 +99,12 @@ export default function ServerTrends({ serverId }: { serverId: number }) {
{failed ? (
- Couldn't load the history.
+ {t("Couldn't load the history.")}
) : series === null ? (
) : series.length === 0 ? (
- No history in this stretch yet. A sample is kept about every ten minutes once the agent has reported, and its hours and days after that, so lines appear here after a short while.
+ {t("No history in this stretch yet. A sample is kept about every ten minutes once the agent has reported, and its hours and days after that, so lines appear here after a short while.")}
) : (
diff --git a/web/src/components/SetupGuide.tsx b/web/src/components/SetupGuide.tsx
index 8478cd0..23f12cc 100644
--- a/web/src/components/SetupGuide.tsx
+++ b/web/src/components/SetupGuide.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { IconCircle, IconCircleCheck, IconX } from "@tabler/icons-react";
+import { t } from "../i18n";
export interface SetupStep {
id: string;
@@ -61,25 +62,25 @@ export default function SetupGuide({ steps }: { steps: SetupStep[] }) {
- Getting started
+ {t("Getting started")}
{done} of {steps.length} done
-
+
-
+
{steps.map((s) => (
-
- {s.done ? : }
+ {s.done ? : }
{s.title}
{!s.done && {s.description} }
diff --git a/web/src/components/ShortcutHelp.tsx b/web/src/components/ShortcutHelp.tsx
index 8660b38..ed23d56 100644
--- a/web/src/components/ShortcutHelp.tsx
+++ b/web/src/components/ShortcutHelp.tsx
@@ -1,6 +1,7 @@
import { useEffect, useId, useRef, useState } from "react";
import { createPortal } from "react-dom";
import { GO_SHORTCUTS, OTHER_SHORTCUTS, SHOW_SHORTCUTS_EVENT } from "../layout/shortcuts";
+import { t } from "../i18n";
/** The keyboard shortcuts, listed. Opens on "?", from the command palette, or when asked for by event. Mount once, near the root. */
export default function ShortcutHelp() {
@@ -49,7 +50,7 @@ export default function ShortcutHelp() {
Keyboard shortcuts
- setOpen(false)} />
+ setOpen(false)} />
Go to a page — press g, then…
diff --git a/web/src/components/SilenceButton.tsx b/web/src/components/SilenceButton.tsx
index ca82de9..134d397 100644
--- a/web/src/components/SilenceButton.tsx
+++ b/web/src/components/SilenceButton.tsx
@@ -2,6 +2,7 @@ import { useState } from "react";
import { api, type AlertItem, type MaintenanceTargetType } from "../api/client";
import { readableError } from "../utils/errors";
import { toast } from "../utils/toast";
+import { t } from "../i18n";
const CHOICES = [
{ minutes: 60, label: "1 h", words: "1 hour" },
@@ -50,7 +51,7 @@ export default function SilenceButton({ alert, target: given, onDone }: { alert?
title={`Silence all alerts about ${target.name} for a while`}
onClick={() => setChoosing(true)}
>
- Silence
+ {t("Silence")}
);
}
@@ -61,7 +62,7 @@ export default function SilenceButton({ alert, target: given, onDone }: { alert?
{c.label}
))}
- setChoosing(false)} aria-label="Cancel">
+ setChoosing(false)} aria-label={t("Cancel")}>
✕
diff --git a/web/src/components/Skeleton.tsx b/web/src/components/Skeleton.tsx
index 2fabe9b..498efb8 100644
--- a/web/src/components/Skeleton.tsx
+++ b/web/src/components/Skeleton.tsx
@@ -1,4 +1,5 @@
import type { CSSProperties } from "react";
+import { t } from "../i18n";
/** A grey bar with a slow shimmer, standing where text or a figure will be, so the page keeps its shape while it loads. */
export function Skeleton({ width = "100%", height = "1rem", className = "", style }: { width?: string | number; height?: string | number; className?: string; style?: CSSProperties }) {
@@ -18,7 +19,7 @@ export function WidgetSkeleton() {
))}
- Loading…
+ {t("Loading…")}
);
}
@@ -31,7 +32,7 @@ export function BlockSkeleton({ lines = 3 }: { lines?: number }) {
{Array.from({ length: lines }, (_, i) => (
))}
- Loading…
+ {t("Loading…")}
);
}
@@ -46,7 +47,7 @@ export function PageSkeleton() {
- Loading…
+ {t("Loading…")}
);
}
diff --git a/web/src/components/StatusPageEditor.tsx b/web/src/components/StatusPageEditor.tsx
index 4b54976..27ff410 100644
--- a/web/src/components/StatusPageEditor.tsx
+++ b/web/src/components/StatusPageEditor.tsx
@@ -5,6 +5,7 @@ import { toast } from "../utils/toast";
import DetailDrawer from "./DetailDrawer";
import { ErrorNotice } from "./Notice";
import { BlockSkeleton } from "./Skeleton";
+import { t } from "../i18n";
interface Choice {
key: string;
@@ -114,13 +115,13 @@ export default function StatusPageEditor({ linkId, linkLabel, onClose, onSaved }
Whoever has the address sees only the name you give each thing and whether it is working — nothing else about it.
setTitle(e.target.value)} />
@@ -140,14 +141,14 @@ export default function StatusPageEditor({ linkId, linkLabel, onClose, onSaved }
- move(i, -1)}>
+ move(i, -1)}>
▲
- move(i, 1)}>
+ move(i, 1)}>
▼
setItems((prev) => prev.filter((_, j) => j !== i))}>
- Remove
+ {t("Remove")}
diff --git a/web/src/components/StatusStrip.tsx b/web/src/components/StatusStrip.tsx
index e026d06..26ed14c 100644
--- a/web/src/components/StatusStrip.tsx
+++ b/web/src/components/StatusStrip.tsx
@@ -4,6 +4,7 @@ import { useAlertsReport } from "../hooks/useAlertsReport";
import { summariseAlerts } from "../utils/alertSummary";
import { CATEGORY_LABELS } from "./RoutingEditor";
import TimeAgo from "./TimeAgo";
+import { t, tn } from "../i18n";
const SEVERITY_ORDER = { critical: 0, warning: 1, info: 2 } as const;
@@ -40,26 +41,26 @@ export default function StatusStrip() {
const unsure = needs === 0 && blind > 0;
const tone = unsure ? "yellow" : sum.tone;
const headline = unsure
- ? "No active alerts, but some checks couldn't run"
+ ? t("No active alerts, but some checks couldn't run")
: needs > 0
- ? `${needs} ${needs === 1 ? "thing needs" : "things need"} attention`
+ ? tn(needs, "{n} thing needs attention", "{n} things need attention")
: sum.acknowledged > 0
- ? "Nothing new"
- : "All clear";
+ ? t("Nothing new")
+ : t("All clear");
const notes: string[] = [];
- if (needs === 0 && sum.acknowledged > 0) notes.push(`${sum.acknowledged} acknowledged — somebody is on ${sum.acknowledged === 1 ? "it" : "them"}`);
- else if (sum.acknowledged > 0) notes.push(`${sum.acknowledged} more acknowledged`);
- if (silenced > 0) notes.push(`${silenced} silenced by maintenance`);
- if (sum.held > 0 && sum.roots.length === 0) notes.push(`${sum.held} more explained by something that is down`);
- if (needs === 0 && !unsure && notes.length === 0) notes.push("No active alerts.");
- if (unsure) notes.push(`${report.couldntCheck.map((c) => c.name).join(", ")} — see Alerts for what that leaves unchecked`);
- else if (blind > 0) notes.push(`${blind} check${blind === 1 ? "" : "s"} couldn't run`);
+ if (needs === 0 && sum.acknowledged > 0) notes.push(tn(sum.acknowledged, "{n} acknowledged — somebody is on it", "{n} acknowledged — somebody is on them"));
+ else if (sum.acknowledged > 0) notes.push(t("{n} more acknowledged", { n: sum.acknowledged }));
+ if (silenced > 0) notes.push(t("{n} silenced by maintenance", { n: silenced }));
+ if (sum.held > 0 && sum.roots.length === 0) notes.push(t("{n} more explained by something that is down", { n: sum.held }));
+ if (needs === 0 && !unsure && notes.length === 0) notes.push(t("No active alerts."));
+ if (unsure) notes.push(t("{names} — see Alerts for what that leaves unchecked", { names: report.couldntCheck.map((c) => c.name).join(", ") }));
+ else if (blind > 0) notes.push(tn(blind, "{n} check couldn't run", "{n} checks couldn't run"));
const Icon = tone === "green" ? IconCircleCheck : IconAlertTriangle;
return (
-
+
@@ -67,7 +68,7 @@ export default function StatusStrip() {
{headline}
- {needs > 0 ? "View all alerts" : "Alerts"}
+ {needs > 0 ? t("View all alerts") : t("Alerts")}
{sum.roots.length > 0 && (
diff --git a/web/src/components/TableToolbar.tsx b/web/src/components/TableToolbar.tsx
index 543697a..e9b0652 100644
--- a/web/src/components/TableToolbar.tsx
+++ b/web/src/components/TableToolbar.tsx
@@ -1,12 +1,13 @@
import type { ReactNode } from "react";
import { IconSearch } from "@tabler/icons-react";
import SaveViewButton from "./SaveViewButton";
+import { t } from "../i18n";
/** The search box every table uses, so they look and behave alike. Esc clears it. */
export function SearchBox({
value,
onChange,
- placeholder = "Search…",
+ placeholder,
className = "",
}: {
value: string;
@@ -14,6 +15,7 @@ export function SearchBox({
placeholder?: string;
className?: string;
}) {
+ const hint = placeholder ?? t("Search…");
return (
@@ -22,8 +24,8 @@ export function SearchBox({
onChange(e.target.value)}
onKeyDown={(e) => e.key === "Escape" && value && onChange("")}
@@ -66,13 +68,13 @@ export default function TableToolbar({
{filters}
- {narrowed && {shown} of {total}}
+ {narrowed && {t("{shown} of {total}", { shown, total })}}
{actions}
{onExport && (
- Export CSV
+ {t("Export CSV")}
)}
diff --git a/web/src/components/TimeAgo.tsx b/web/src/components/TimeAgo.tsx
index b541280..0c47732 100644
--- a/web/src/components/TimeAgo.tsx
+++ b/web/src/components/TimeAgo.tsx
@@ -1,6 +1,7 @@
import { useSyncExternalStore } from "react";
import { formatDateTime, parseDbTimestamp } from "../utils/date";
import { formatAgo, formatRemaining } from "../utils/duration";
+import { t } from "../i18n";
// One shared clock for every TimeAgo on screen: "5 min ago" moves on by itself without each one running its own timer.
const listeners = new Set<() => void>();
@@ -39,7 +40,7 @@ export default function TimeAgo({ value, fromDb, empty = "—" }: { value: strin
const future = date.getTime() > Date.now() + 60_000;
return (
);
}
diff --git a/web/src/components/ToastHost.tsx b/web/src/components/ToastHost.tsx
index ac4e945..1c6a294 100644
--- a/web/src/components/ToastHost.tsx
+++ b/web/src/components/ToastHost.tsx
@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { createPortal } from "react-dom";
import { IconAlertTriangle, IconCircleCheck, IconInfoCircle, IconX } from "@tabler/icons-react";
import { dismissToast, subscribeToasts, type ToastItem } from "../utils/toast";
+import { t } from "../i18n";
const LIFETIME_MS = { success: 4_500, info: 6_000, error: 9_000 } as const;
/** A toast with a button stays long enough to decide to press it. */
@@ -39,7 +40,7 @@ function ToastView({ item }: { item: ToastItem }) {
{item.action.label}
)}
- dismissToast(item.id)}>
+ dismissToast(item.id)}>
diff --git a/web/src/components/TodosCard.tsx b/web/src/components/TodosCard.tsx
index 0f21b79..4a7eee3 100644
--- a/web/src/components/TodosCard.tsx
+++ b/web/src/components/TodosCard.tsx
@@ -6,6 +6,7 @@ import { BlockSkeleton } from "./Skeleton";
import { refreshMyWork } from "../hooks/useMyWork";
import { readableError } from "../utils/errors";
import { toast } from "../utils/toast";
+import { t } from "../i18n";
/**
* The open jobs on the to-do list that are about this server or device, with a box to tick one off and (for operators) a line to add another that is already about it.
@@ -80,7 +81,7 @@ export default function TodosCard({ targetType, targetId, canEdit, bare = false
) : jobs === null ? (
) : jobs.length === 0 ? (
- Nothing to do about this.
+ {t("Nothing to do about this.")}
) : (
{jobs.map((t) => {
@@ -107,15 +108,15 @@ export default function TodosCard({ targetType, targetId, canEdit, bare = false
)}
{canEdit && (
)}
- All jobs
+ {t("All jobs")}
>
);
@@ -123,14 +124,14 @@ export default function TodosCard({ targetType, targetId, canEdit, bare = false
if (bare)
return (
<>
- To do
+ {t("To do")}
{content}
>
);
return (
- To do{jobs && jobs.length > 0 ? ` (${jobs.length})` : ""}
+ {t("To do")}{jobs && jobs.length > 0 ? ` (${jobs.length})` : ""}
{content}
diff --git a/web/src/components/UpdateRunDrawer.tsx b/web/src/components/UpdateRunDrawer.tsx
index 6126979..2aa237f 100644
--- a/web/src/components/UpdateRunDrawer.tsx
+++ b/web/src/components/UpdateRunDrawer.tsx
@@ -8,6 +8,7 @@ import { toast } from "../utils/toast";
import DetailDrawer from "./DetailDrawer";
import { BlockSkeleton } from "./Skeleton";
import UpdatesBadge from "./UpdatesBadge";
+import { t } from "../i18n";
interface Loaded {
integration: IntegrationSummary;
@@ -145,15 +146,15 @@ export default function UpdateRunDrawer({ server, mode = "update", onClose, onSt
{failed ? (
- Couldn't load the integrations.
+ {t("Couldn't load the integrations.")}
) : loaded === null ? (
) : loaded.length === 0 ? (
- There is no Semaphore connected. Add one under Integrations, with a playbook that {restartOnly ? "restarts a server" : "applies updates"}, and this server can be {restartOnly ? "restarted" : "updated"} from here.
+ There is no Semaphore connected. Add one under {t("Integrations")}, with a playbook that {restartOnly ? "restarts a server" : "applies updates"}, and this server can be {restartOnly ? "restarted" : "updated"} from here.
) : options.length === 0 ? (
- No templates found in Semaphore.
+ {t("No templates found in Semaphore.")}
) : (
<>
@@ -161,19 +162,19 @@ export default function UpdateRunDrawer({ server, mode = "update", onClose, onSt
{watching && (
- Somebody is watching. {watching[0].toUpperCase()}
+ {t("Somebody is watching.")} {watching[0].toUpperCase()}
{watching.slice(1)}. {restartOnly ? "The restart will cut them off" : "The update may restart this machine"}; you will be asked once more.
)}
- - Alerts for this server are silenced (a maintenance window).
- - The playbook runs in Semaphore, for this server only.
- - Homelab Manager waits for the server to report again — it may be restarting.
+ - {t("Alerts for this server are silenced (a maintenance window).")}
+ - {t("The playbook runs in Semaphore, for this server only.")}
+ - {t("Homelab Manager waits for the server to report again — it may be restarting.")}
{restartOnly ? (
- - It checks that the server did start again (from its uptime), and the window ends.
+ - {t("It checks that the server did start again (from its uptime), and the window ends.")}
) : (
<>
- {restartPicked && - If the server then says a restart is due, the restart playbook runs, and the server is checked to have started again.
}
+ {restartPicked && - {t("If the server then says a restart is due, the restart playbook runs, and the server is checked to have started again.")}
}
- It tells you what is still waiting{restartPicked ? "" : " and whether a restart is due"}, and the window ends.
>
)}
@@ -183,7 +184,7 @@ export default function UpdateRunDrawer({ server, mode = "update", onClose, onSt
{restartOnly ? "Playbook that restarts the server" : "Playbook that applies updates"}
|