hensei-web/i18n/request.ts
Justin Edmund 218a524b55 Fix Party component interface and remove unstable_cache
- Update NewPartyClient and PartyPageClient to use correct Party props
- Remove unstable_cache from all data fetching functions
- Fix viewport metadata configuration in App Router
- Restore ToastViewport component in layout
- Fix import paths from 'types' to '~types' in Party components
- Add comprehensive PRD documenting the fixes

This addresses the interface mismatch between Party component and its
client wrappers that occurred during the App Router migration.
2025-09-01 19:06:22 -07:00

17 lines
689 B
TypeScript

import {getRequestConfig} from 'next-intl/server'
import {locales, defaultLocale, type Locale} from '../i18n.config'
// next-intl v4: global request config used by getMessages()
export default getRequestConfig(async ({requestLocale}) => {
let locale = (await requestLocale) as Locale | null;
if (!locale || !locales.includes(locale)) {
locale = defaultLocale;
}
// Load only i18n namespaces; exclude content data with dotted keys
const common = (await import(`../public/locales/${locale}/common.json`)).default;
const about = (await import(`../public/locales/${locale}/about.json`)).default;
const messages = {common, about} as const;
return {locale, messages};
});