i18n: translate all public page bodies (EN + IT)

Internationalised the ~44 public pages with next-intl (the shell was
already translated). Each page now pulls its copy from a "pages.<slug>"
namespace via getTranslations (server) / useTranslations (client); the
EN + IT catalogs were authored by parallel agents and merged centrally,
with natural Italian (ICU plurals) and it backfilled from en for any
gap. request.ts gained getMessageFallback/onError so a missing key
degrades to the English value, never a raw key.

Behaviour unchanged (only display text moved to t() calls; queries,
actions, fields, ContentCard structure preserved). Verified on the prod
server: with NEXT_LOCALE=it, home/community/staff/news/shop/rankings all
render Italian copy, no raw-key leakage; English unchanged. The nav
language switcher toggles EN/IT live. tsc 0, vitest 49/49, next build 0.

Admin pages intentionally left in English (staff tooling).
This commit is contained in:
Simo committed 2026-06-28 20:40:06 +02:00
1 parent 1199176883
commit e004dfedaf
47 files changed
+1740 -471

No files matched your search

+14 -17
View File
@@ -1,3 +1,4 @@
import { useTranslations } from "next-intl";
import Link from "next/link";
import { ContentCard } from "@/components/public/ui";
@@ -7,50 +8,46 @@ export const metadata = { title: "Community" };
const LINKS = [
{
key: "rankings",
href: "/rankings",
icon: "🏆",
title: "Rankings",
text: "See the wealthiest players in the hotel, ranked by credits.",
},
{
key: "staff",
href: "/staff",
icon: "🛡️",
title: "Staff",
text: "Meet the team that keeps the hotel running every day.",
},
{
key: "news",
href: "/news",
icon: "📰",
title: "News",
text: "The latest announcements, events and updates.",
},
{
key: "photos",
href: "/photos",
icon: "📸",
title: "Photos",
text: "Snapshots shared by the community from around the hotel.",
},
{
key: "guilds",
href: "/guilds",
icon: "🚪",
title: "Guilds",
text: "Browse the groups players have created and joined.",
},
{
key: "leaderboards",
href: "/leaderboard",
icon: "📊",
title: "Leaderboards",
text: "Who's on top this season across the hotel's stats.",
},
];
export default function CommunityPage() {
const t = useTranslations("pages.community");
return (
<main style={{ display: "grid", gap: "1.5rem" }}>
<ContentCard
icon="🌍"
title="Community"
subtitle="Everything happening around the hotel in one place"
title={t("title")}
subtitle={t("subtitle")}
/>
<div className="card-grid sm-2 lg-3">
@@ -66,14 +63,14 @@ export default function CommunityPage() {
{l.icon}
</span>
<div className="content-card-head-text">
<p className="content-card-title">{l.title}</p>
<p className="content-card-title">{t(`links.${l.key}.title`)}</p>
</div>
</div>
<div className="content-card-body">
<p className="muted" style={{ margin: "0 0 0.75rem" }}>
{l.text}
{t(`links.${l.key}.text`)}
</p>
<span className="btn btn-outline">Open →</span>
<span className="btn btn-outline">{t("open")}</span>
</div>
</Link>
))}