Fix Edge-incompatible middleware; set Node runtime on Prisma/pg routes; add full Romanian Bible import + converter; import data JSON; resync RO bookKeys; stabilize /api/bible/books locale fallback; restart dev server.

This commit is contained in:
andupetcu
2025-09-20 18:01:04 +03:00
parent 500066450d
commit 88b251c100
28 changed files with 127926 additions and 175 deletions

22
i18n/request.ts Normal file
View File

@@ -0,0 +1,22 @@
import { getRequestConfig } from 'next-intl/server'
import { headers } from 'next/headers'
export default getRequestConfig(async () => {
// This will be called for each request and determines
// which locale to use based on the URL
const headersList = await headers()
const pathname = headersList.get('x-pathname') || ''
// Extract locale from pathname (e.g., /en/bible -> en)
const segments = pathname.split('/')
const locale = segments[1] || 'ro' // Default to Romanian
// Validate that the locale is supported
const supportedLocales = ['en', 'ro']
const finalLocale = supportedLocales.includes(locale) ? locale : 'ro'
return {
locale: finalLocale,
messages: (await import(`../messages/${finalLocale}.json`)).default
}
})