feat(i18n): add localized navigation and news translations

This commit is contained in:
2026-02-12 21:29:15 +01:00
parent 618319dbc2
commit a7895e4dd9
12 changed files with 687 additions and 164 deletions

View File

@@ -1,15 +1,15 @@
import { getPostBySlug } from "@cms/db"
import { getPostBySlugForLocale } from "@cms/db"
import { notFound } from "next/navigation"
export const dynamic = "force-dynamic"
type PageProps = {
params: Promise<{ slug: string }>
params: Promise<{ locale: string; slug: string }>
}
export default async function PublicNewsDetailPage({ params }: PageProps) {
const { slug } = await params
const post = await getPostBySlug(slug)
const { locale, slug } = await params
const post = await getPostBySlugForLocale(slug, locale)
if (!post || post.status !== "published") {
notFound()

View File

@@ -1,10 +1,15 @@
import { listPosts } from "@cms/db"
import { listPostsForLocale } from "@cms/db"
import Link from "next/link"
export const dynamic = "force-dynamic"
export default async function PublicNewsIndexPage() {
const posts = await listPosts()
type PublicNewsIndexPageProps = {
params: Promise<{ locale: string }>
}
export default async function PublicNewsIndexPage({ params }: PublicNewsIndexPageProps) {
const { locale } = await params
const posts = await listPostsForLocale(locale)
return (
<section className="mx-auto w-full max-w-4xl space-y-4 px-6 py-16">