Translate admin panel to all 6 languages

This commit is contained in:
openhands committed 2026-07-04 21:21:15 +02:00
1 parent f381aa987f
commit befa4ec282
63 files changed
+9353 -1443

No files matched your search

+19 -17
View File
@@ -1,3 +1,4 @@
import { getTranslations } from "next-intl/server";
import { Navigation } from "lucide-react";
import { StatusCard } from "@/components/admin/dashboard";
import { prisma } from "@/lib/prisma";
@@ -35,6 +36,7 @@ function YesNo({ on }: { on: boolean }) {
}
export default async function AdminNavigation() {
const t = await getTranslations("pages.admin.navigation");
let flatcats: Flatcat[] = [];
try {
flatcats = await prisma.navigatorFlatcats.findMany({
@@ -108,22 +110,22 @@ export default async function AdminNavigation() {
<Navigation size={20} className="text-[var(--color-primary)]" />
</div>
<div>
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">Navigator</h1>
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">Read-only · the navigator config is owned by the emulator. Edit it in your emulator tooling, not here.</p>
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">{t("title")}</h1>
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">{t("subtitle")}</p>
</div>
</div>
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
<StatusCard label="Flat categories" value={flatcats.length} icon="📂" />
<StatusCard label={t("flatCategories")} value={flatcats.length} icon="📂" />
<StatusCard
label="Public (flatcats)"
label={t("publicFlatcats")}
value={publicFlatcats}
hint="marked public"
hint={t("markedPublic")}
icon="🌐"
/>
<StatusCard label="Public rooms" value={publics.length} icon="🚪" />
<StatusCard label={t("publicRooms")} value={publics.length} icon="🚪" />
<StatusCard
label="Visible rooms"
label={t("visibleRooms")}
value={visiblePublics}
state={visiblePublics > 0 ? "ok" : "neutral"}
icon="👁️"
@@ -132,18 +134,18 @@ export default async function AdminNavigation() {
{/* ── navigator_flatcats ───────────────────────────────── */}
<section className="mt-6">
<h2 className="admin-section-title">Flat categories</h2>
<h2 className="admin-section-title">{t("flatCategories")}</h2>
<p className="text-xs text-gray-500 dark:text-gray-400">
<code>navigator_flatcats</code> · {flatcats.length} rows
<code>navigator_flatcats</code> · {flatcats.length} {t("rows")}
</p>
{flatcats.length === 0 ? (
<div className="admin-empty">No flat categories found.</div>
<div className="admin-empty">{t("noCategories")}</div>
) : (
<div className="overflow-x-auto">
<table>
<thead>
<tr>
<th>ID</th>
<th>{t("colId")}</th>
<th>Caption</th>
<th>Caption (save)</th>
<th>Min rank</th>
@@ -151,7 +153,7 @@ export default async function AdminNavigation() {
<th>Can trade</th>
<th>Public</th>
<th>List type</th>
<th>Order</th>
<th>{t("colOrder")}</th>
</tr>
</thead>
<tbody>
@@ -180,19 +182,19 @@ export default async function AdminNavigation() {
{/* ── navigator_publics ────────────────────────────────── */}
<section className="mt-6">
<h2 className="admin-section-title">Public rooms</h2>
<h2 className="admin-section-title">{t("publicRooms")}</h2>
<p className="text-xs text-gray-500 dark:text-gray-400">
<code>navigator_publics</code> · {publics.length} rows
<code>navigator_publics</code> · {publics.length} {t("rows")}
</p>
{publics.length === 0 ? (
<div className="admin-empty">No public-room assignments found.</div>
<div className="admin-empty">{t("noPublicRooms")}</div>
) : (
<div className="overflow-x-auto">
<table>
<thead>
<tr>
<th>Public cat</th>
<th>Room</th>
<th>{t("colName")}</th>
<th>Visible</th>
</tr>
</thead>
@@ -204,7 +206,7 @@ export default async function AdminNavigation() {
<span className="text-sm text-gray-500 dark:text-gray-400">#{p.public_cat_id}</span>
</td>
<td>
{roomNameById.get(p.room_id) || "(unnamed)"}{" "}
{roomNameById.get(p.room_id) || t("unnamed")}{" "}
<span className="text-sm text-gray-500 dark:text-gray-400">#{p.room_id}</span>
</td>
<td>