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
@@ -7,6 +7,7 @@ import { downloadCsv } from "../utils/csv";
|
||||
import { confirmDialog } from "../utils/dialogs";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { EmptyRow, LoadingRow } from "../components/EmptyState";
|
||||
import { t } from "../i18n";
|
||||
|
||||
const SOURCE_LABELS: Record<string, string> = {
|
||||
cloudflare: "Cloudflare",
|
||||
@@ -108,7 +109,7 @@ export default function DiagLogView() {
|
||||
<div className="card-body">
|
||||
<div className="row g-2 align-items-end">
|
||||
<div className="col-md-3">
|
||||
<label className="form-label">Source</label>
|
||||
<label className="form-label">{t("Source")}</label>
|
||||
<select className="form-select" value={filterSource} onChange={(e) => setFilterSource(e.target.value)}>
|
||||
<option value="">All sources</option>
|
||||
{Object.entries(SOURCE_LABELS).map(([value, label]) => (
|
||||
@@ -131,7 +132,7 @@ export default function DiagLogView() {
|
||||
{loading ? "Refreshing…" : "Refresh"}
|
||||
</button>
|
||||
<button className="btn btn-outline-secondary" onClick={exportCsv} disabled={!sorted || sorted.length === 0}>
|
||||
Export CSV
|
||||
{t("Export CSV")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,7 +151,7 @@ export default function DiagLogView() {
|
||||
<thead>
|
||||
<tr>
|
||||
<SortableTh<DiagLogEntry> label="Time" sortKeyName="createdAt" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DiagLogEntry> label="Source" sortKeyName="source" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DiagLogEntry> label={t("Source")} sortKeyName="source" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DiagLogEntry> label="Operation" sortKeyName="operation" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DiagLogEntry> label="Result" sortKeyName="ok" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DiagLogEntry>
|
||||
@@ -173,7 +174,7 @@ export default function DiagLogView() {
|
||||
<td className="text-secondary">{e.operation}</td>
|
||||
<td>
|
||||
{e.ok ? (
|
||||
<span className="badge bg-green-lt text-green">OK</span>
|
||||
<span className="badge bg-green-lt text-green">{t("OK")}</span>
|
||||
) : (
|
||||
<span className="badge bg-red-lt text-red">Error</span>
|
||||
)}
|
||||
@@ -194,13 +195,13 @@ export default function DiagLogView() {
|
||||
{totalPages > 1 && (
|
||||
<div className="card-footer d-flex align-items-center justify-content-between">
|
||||
<button className="btn btn-outline-secondary" onClick={() => goToPage(page - 1)} disabled={page === 0}>
|
||||
← Prev
|
||||
{t("← Prev")}
|
||||
</button>
|
||||
<span className="text-secondary">
|
||||
Page {page + 1} of {totalPages}
|
||||
</span>
|
||||
<button className="btn btn-outline-secondary" onClick={() => goToPage(page + 1)} disabled={page >= totalPages - 1}>
|
||||
Next →
|
||||
{t("Next →")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user