locale upgrade

This commit is contained in:
2026-01-22 20:56:35 +01:00
parent 377631ee50
commit 37a1bc4e18
28 changed files with 2117 additions and 71 deletions

View File

@@ -2,6 +2,16 @@ import { NextIntlClientProvider } from "next-intl";
import { setRequestLocale } from "next-intl/server";
import React from "react";
import ConsentBanner from "../components/ConsentBanner";
import { getLocalizedMessage } from "@/lib/i18n-loader";
async function loadEnhancedMessages(locale: string) {
// Lade basis JSON Messages
const baseMessages = (await import(`../../messages/${locale}.json`)).default;
// Erweitere mit Directus (wenn verfügbar)
// Für jetzt: return base messages, Directus wird per Server Component geladen
return baseMessages;
}
export default async function LocaleLayout({
children,
@@ -15,7 +25,7 @@ export default async function LocaleLayout({
setRequestLocale(locale);
// Load messages explicitly by route locale to avoid falling back to the wrong
// language when request-level locale detection is unavailable/misconfigured.
const messages = (await import(`../../messages/${locale}.json`)).default;
const messages = await loadEnhancedMessages(locale);
return (
<NextIntlClientProvider locale={locale} messages={messages}>