CodebaseSrc
I18n
Server-side internationalization (i18n) configuration using next-intl.
Internationalization Configuration
Server-side internationalization (i18n) configuration using next-intl.
Purpose
Configures next-intl for the Next.js App Router, providing translation loading and locale handling for Server Components.
Key Files
request.ts- ExportsgetRequestConfigfor next-intl, loads translation messages based on the current locale
How It Works
- Reads the
x-localeheader set by Next.js middleware - Dynamically imports the corresponding translation file from
../locales/ - Returns configuration with locale and messages for next-intl to use
Supported Locales
Currently supports English (en) as the default and only locale. Additional locales can be added by:
- Adding locale to the
localesarray inrequest.ts - Creating corresponding JSON file in
src/locales/