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

+7 -6
View File
@@ -8,17 +8,18 @@ import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
import FigureHistory from "../components/FigureHistory";
import { t } from "../i18n";
/** Alerts every pipeline carries to prove it works: they are always firing, so they are not shown as firing. */
const BY_DESIGN = /^(watchdog|deadmansswitch|deadmanssnitch|infoinhibitor)$/i;
function Badge({ p }: { p: PrometheusInfo }) {
if (!p.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
if (!p.state) return <span className="badge bg-secondary-lt text-secondary">Not read yet</span>;
if (!p.state) return <span className="badge bg-secondary-lt text-secondary">{t("Not read yet")}</span>;
if (!p.fresh) return <span className="badge bg-yellow-lt text-yellow">Can&rsquo;t be read</span>;
if (p.problems.some((x) => x.severity === "critical")) return <span className="badge bg-red-lt text-red">Needs a look</span>;
if (p.problems.length > 0) return <span className="badge bg-yellow-lt text-yellow">Needs a look</span>;
return <span className="badge bg-green-lt text-green">In order</span>;
if (p.problems.some((x) => x.severity === "critical")) return <span className="badge bg-red-lt text-red">{t("Needs a look")}</span>;
if (p.problems.length > 0) return <span className="badge bg-yellow-lt text-yellow">{t("Needs a look")}</span>;
return <span className="badge bg-green-lt text-green">{t("In order")}</span>;
}
function Card({ p }: { p: PrometheusInfo }) {
@@ -140,8 +141,8 @@ export default function Prometheus() {
<>
<h2 className="page-title">Prometheus</h2>
<PageIntro>
What Prometheus already measures, in the same list as everything else. It is read every couple of minutes (see <Link to="/integrations">Integrations</Link>). A <strong>target that has not answered for five minutes</strong> and an <strong>alert that Prometheus&rsquo;s rules are firing</strong> are
alerts — see <Link to="/alerts">Alerts</Link>. Alerts that Grafana manages itself are not seen.
What Prometheus already measures, in the same list as everything else. It is read every couple of minutes (see <Link to="/integrations">{t("Integrations")}</Link>). A <strong>target that has not answered for five minutes</strong> and an <strong>alert that Prometheus&rsquo;s rules are firing</strong> are
alerts — see <Link to="/alerts">{t("Alerts")}</Link>. Alerts that Grafana manages itself are not seen.
</PageIntro>
<ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />}