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

+22 -19
View File
@@ -1,4 +1,5 @@
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { notFound } from "next/navigation";
import { prisma } from "@/lib/prisma";
@@ -35,6 +36,8 @@ export default async function AdminCatalogPage({
}: {
params: Promise<{ id: string }>;
}) {
const t = await getTranslations("pages.admin.catalog");
const { id } = await params;
const pageId = Number(id);
if (!Number.isInteger(pageId)) notFound();
@@ -89,32 +92,32 @@ export default async function AdminCatalogPage({
return (
<main>
<p className="muted">
<Link href="/admin/catalog">← Catalog</Link>
<Link href="/admin/catalog">← {t("title")}</Link>
</p>
<h1>{page.caption}</h1>
<p className="muted">
Page #{page.id} · layout {page.pageLayout} · min rank {page.minRank} ·{" "}
{hidden ? "Hidden" : "Visible"}
{page.parentId > 0 ? ` · parent #${page.parentId}` : ""}
{page.clubOnly === "1" ? " · HC only" : ""}
{page.vipOnly === "1" ? " · VIP only" : ""}
{t("pageLabel", { id: page.id })} · {t("layoutLabel", { layout: page.pageLayout })} · {t("minRankLabel", { rank: page.minRank })} ·{" "}
{hidden ? t("statusHidden") : t("statusVisible")}
{page.parentId > 0 ? ` · ${t("parentLabel", { id: page.parentId })}` : ""}
{page.clubOnly === "1" ? ` · ${t("hcOnly")}` : ""}
{page.vipOnly === "1" ? ` · ${t("vipOnly")}` : ""}
</p>
<h2 style={{ marginTop: "1.5rem" }}>Items</h2>
<h2 style={{ marginTop: "1.5rem" }}>{t("items")}</h2>
{items.length === 0 ? (
<p className="muted">No items on this page.</p>
<p className="muted">{t("noItems")}</p>
) : (
<table style={{ width: "100%", borderCollapse: "collapse" }}>
<thead>
<tr style={{ textAlign: "left", color: "var(--muted)" }}>
<th>ID</th>
<th>Catalog name</th>
<th>Item IDs</th>
<th>Amount</th>
<th>Credits</th>
<th>Points</th>
<th>Limited</th>
<th>Order</th>
<th>{t("colId")}</th>
<th>{t("catalogName")}</th>
<th>{t("itemIds")}</th>
<th>{t("amount")}</th>
<th>{t("colCostCredits")}</th>
<th>{t("colCostPoints")}</th>
<th>{t("colLimited")}</th>
<th>{t("colOrder")}</th>
</tr>
</thead>
<tbody>
@@ -124,7 +127,7 @@ export default async function AdminCatalogPage({
<td>
{it.catalogName}
{it.clubOnly === "1" ? (
<span className="muted"> · HC</span>
<span className="muted"> · {t("hc")}</span>
) : null}
</td>
<td className="muted">{it.itemIds}</td>
@@ -138,7 +141,7 @@ export default async function AdminCatalogPage({
</td>
<td className="muted">
{it.costPoints > 0
? `${it.costPoints} (type ${it.pointsType})`
? `${it.costPoints} (${t("typeLabel", { type: it.pointsType })})`
: "—"}
</td>
<td className="muted">
@@ -154,7 +157,7 @@ export default async function AdminCatalogPage({
)}
<p className="muted" style={{ marginTop: "1rem" }}>
{items.length} item{items.length === 1 ? "" : "s"}
{t("itemCount", { count: items.length })}
</p>
</main>
);