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

+20 -18
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";
import { Calendar } from "lucide-react";
@@ -40,6 +41,8 @@ export default async function AdminCalendarCampaign({
}: {
params: Promise<{ id: string }>;
}) {
const t = await getTranslations("pages.admin.calendar");
const { id } = await params;
const campaignId = Number(id);
if (!Number.isInteger(campaignId)) notFound();
@@ -93,7 +96,7 @@ export default async function AdminCalendarCampaign({
return (
<main>
<p className="text-xs text-gray-500 dark:text-gray-400 mb-4">
<Link href="/admin/calendar">← Calendar campaigns</Link>
<Link href="/admin/calendar">← {t("title")}</Link>
</p>
<div className="admin-card flex items-center gap-5 mb-6">
@@ -106,31 +109,30 @@ export default async function AdminCalendarCampaign({
/>
) : null}
<div>
<h1 className="m-0 mb-1">{campaign.name || `Campaign #${campaign.id}`}</h1>
<h1 className="m-0 mb-1">{campaign.name || `#${campaign.id}`}</h1>
<p className="text-xs text-gray-500 dark:text-gray-400 m-0">
#{campaign.id} · {campaign.totalDays} day{campaign.totalDays === 1 ? "" : "s"} · starts{" "}
{fmtDate(campaign.startTimestamp)}
{disabled ? " · Disabled" : " · Enabled"}
{campaign.lockExpired === "1" ? " · Locks expired days" : ""}
{t("detail.campaignMeta", { id: campaign.id, days: campaign.totalDays, date: fmtDate(campaign.startTimestamp) })}
{disabled ? ` · ${t("detail.disabled")}` : ` · ${t("detail.enabled")}`}
{campaign.lockExpired === "1" ? ` · ${t("detail.locksExpired")}` : ""}
</p>
</div>
</div>
<h2 className="admin-section-title">Rewards</h2>
<h2 className="admin-section-title">{t("detail.rewards")}</h2>
{rewards.length === 0 ? (
<div className="admin-empty">No rewards configured for this campaign.</div>
<div className="admin-empty">{t("detail.noRewards")}</div>
) : (
<table className="w-full">
<thead>
<tr className="text-left text-[var(--muted)]">
<th>ID</th>
<th>Product</th>
<th>Item</th>
<th>Credits</th>
<th>Pixels</th>
<th>Points</th>
<th>Badge</th>
<th>Subscription</th>
<th>{t("detail.colId")}</th>
<th>{t("detail.colProduct")}</th>
<th>{t("detail.colItem")}</th>
<th>{t("detail.colCredits")}</th>
<th>{t("detail.colPixels")}</th>
<th>{t("detail.colPoints")}</th>
<th>{t("detail.colBadge")}</th>
<th>{t("detail.colSubscription")}</th>
</tr>
</thead>
<tbody>
@@ -143,7 +145,7 @@ export default async function AdminCalendarCampaign({
<td>{r.pixels > 0 ? r.pixels : <span className="text-sm text-gray-500 dark:text-gray-400">—</span>}</td>
<td>
{r.points > 0 ? (
`${r.points} (type ${r.pointsType})`
`${r.points} (${t("detail.typeLabel", { type: r.pointsType })})`
) : (
<span className="text-sm text-gray-500 dark:text-gray-400">—</span>
)}
@@ -161,7 +163,7 @@ export default async function AdminCalendarCampaign({
)}
<p className="text-xs text-gray-500 dark:text-gray-400 mt-4">
{rewards.length} reward{rewards.length === 1 ? "" : "s"}
{t("detail.rewardCount", { count: rewards.length })}
</p>
</main>
);