mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 19:44:12 +00:00
Localization: - Add middleware for locale detection/routing - Add [locale] dynamic route structure - Add i18n utility library (DE/EN support) SEO & Discovery: - Add robots.ts for search engine directives - Add sitemap.ts for XML sitemap generation - Add structuredData.ts for JSON-LD schemas Utilities: - Add search.ts for full-text search functionality - Add tenantAccess.ts for multi-tenant access control - Add envValidation.ts for environment validation Frontend: - Update layout.tsx with locale support - Update page.tsx for localized content - Add API routes for frontend functionality - Add instrumentation.ts for monitoring 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
705 B
TypeScript
30 lines
705 B
TypeScript
import React from 'react'
|
|
import { notFound } from 'next/navigation'
|
|
import { isValidLocale, locales, getLocaleDirection, type Locale } from '@/lib/i18n'
|
|
|
|
export function generateStaticParams() {
|
|
return locales.map((locale) => ({ locale }))
|
|
}
|
|
|
|
interface LocaleLayoutProps {
|
|
children: React.ReactNode
|
|
params: Promise<{ locale: string }>
|
|
}
|
|
|
|
export default async function LocaleLayout({ children, params }: LocaleLayoutProps) {
|
|
const { locale } = await params
|
|
|
|
if (!isValidLocale(locale)) {
|
|
notFound()
|
|
}
|
|
|
|
const direction = getLocaleDirection(locale as Locale)
|
|
|
|
return (
|
|
<html lang={locale} dir={direction}>
|
|
<body>
|
|
<main>{children}</main>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|