Internationalization
The i18n module provides multi-language support using next-intl.
Overview
- Location:
modules/i18n - Key Files:
locales/: JSON files containing translation strings (e.g.,en/common.json).request.ts: Request-scoped internationalization setup.routing.ts: Path-based routing configuration (e.g.,/en/about).
Adding Translations
Add new content to the JSON files in modules/i18n/locales/{lang}.
en/common.json:
Usage
Use the useTranslations hook in components:
Routing
The middleware automatically handles locale detection and routing. URLs are prefixed with the locale (e.g., /en, /es), except for the default locale if configured otherwise.
Last updated on