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:
1 parent
e7f23ba13f
commit
645816d5a8
168 files changed
+12142
-1422
No files matched your search
@@ -9,6 +9,7 @@ import EmptyState from "../components/EmptyState";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { formatDate, formatTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { t } from "../i18n";
|
||||
|
||||
const TONE_DOT: Record<ChangeEntry["tone"], string> = { good: "#2fb344", bad: "#e05252", info: "#4299e1", neutral: "#8a94a6" };
|
||||
|
||||
@@ -42,7 +43,7 @@ export default function ChangeLog() {
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-2">
|
||||
<h2 className="page-title mb-0">Change log</h2>
|
||||
<h2 className="page-title mb-0">{t("Change log")}</h2>
|
||||
</div>
|
||||
{changeTabs("audit")}
|
||||
<AuditLogView />
|
||||
@@ -144,9 +145,9 @@ function ReadableChanges({ tabs }: { tabs: ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex flex-wrap align-items-center gap-2 mb-1">
|
||||
<h2 className="page-title mb-0">Change log</h2>
|
||||
<h2 className="page-title mb-0">{t("Change log")}</h2>
|
||||
<button className="btn btn-outline-secondary ms-auto" onClick={exportCsv} disabled={!entries || entries.length === 0}>
|
||||
Export CSV
|
||||
{t("Export CSV")}
|
||||
</button>
|
||||
</div>
|
||||
{tabs}
|
||||
@@ -159,15 +160,15 @@ function ReadableChanges({ tabs }: { tabs: ReactNode }) {
|
||||
<div className="card-body d-flex flex-wrap gap-2 align-items-center">
|
||||
<input className="form-control w-auto flex-grow-1" style={{ maxWidth: "22rem" }} type="search" aria-label="Search the change log" placeholder="Search: a server, a person, a word…" value={text} onChange={(e) => setText(e.target.value)} />
|
||||
<select className="form-select w-auto" aria-label="Kind of change" value={kind} onChange={(e) => setParam("kind", e.target.value || null)}>
|
||||
<option value="">All kinds</option>
|
||||
<option value="">{t("All kinds")}</option>
|
||||
{kinds.map((k) => (
|
||||
<option key={k.id} value={k.id}>
|
||||
{k.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<select className="form-select w-auto" aria-label="Server" value={serverId ?? ""} onChange={(e) => setParam("serverId", e.target.value || null)}>
|
||||
<option value="">Every server</option>
|
||||
<select className="form-select w-auto" aria-label={t("Server")} value={serverId ?? ""} onChange={(e) => setParam("serverId", e.target.value || null)}>
|
||||
<option value="">{t("Every server")}</option>
|
||||
{servers.map((s) => (
|
||||
<option key={s.id} value={s.id}>
|
||||
{s.name}
|
||||
@@ -190,7 +191,7 @@ function ReadableChanges({ tabs }: { tabs: ReactNode }) {
|
||||
{q || kind || serverId ? (
|
||||
<EmptyState
|
||||
filtered
|
||||
title="Nothing matches that"
|
||||
title={t("Nothing matches that")}
|
||||
hint={`Nothing in ${RANGES.find((r) => r.days === days)?.label.toLowerCase()} fits what is searched for. Try a wider range, or fewer filters.`}
|
||||
action={{ label: "Clear the search and filters", onClick: () => { setText(""); setParams(new URLSearchParams(), { replace: true }); } }}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user