Internationalization
Fast Unicorn uses next-intl with the locale in the URL path.
Internationalization is not treated as an afterthought. Marketing pages, auth flows, dashboard routes, and payment result pages all participate in the same locale-aware structure from the start.
Need to add a new language?
This page is the feature overview. For the implementation workflow, continue with Add a Locale.
What this feature includes
Locale-prefixed routes
User-facing routes are organized under the locale segment so navigation and rendering stay consistent across languages.
Request-time message loading
The app resolves the active locale and loads the matching message file on demand.
Config-driven translation keys
Dashboard labels, pricing content, and other config-driven surfaces still rely on synchronized translation keys.
Supported locales
Locales are defined in src/i18n/routing.ts.
Current locales:
enescn
The default locale is en.
Main files and folders
- src/i18n/routing.ts: Supported locales and route-level i18n configuration.
- src/i18n/request.ts: Request-time message resolution and loading.
- src/middleware.ts: Locale-aware routing entry behavior.
- messages/en/*.json: English translation files (system.json, navbar.json, dashboard.json, auth.json).
- messages/es/*.json: Spanish translation files.
- messages/cn/*.json: Chinese translation files.
Routing model
All user-facing pages are grouped under src/app/[locale].
This means marketing pages, auth pages, dashboard pages, and payment result pages all participate in the same localized route structure.
That shared structure makes locale support feel consistent instead of bolted onto specific features later.
Message loading
Request-time message loading is handled in src/i18n/request.ts.
The loader:
- resolves the requested locale
- falls back to the default locale if the incoming value is invalid
- imports the matching JSON file from
messages/
This gives the app a stable fallback model even when a requested locale is missing or invalid.
Translation files
Localized messages are organized as directories with per-concern JSON files:
messages/en/—system.json,navbar.json,dashboard.json,auth.jsonmessages/es/— same structuremessages/cn/— same structure
Adding a new locale
- Add the locale to
src/i18n/routing.ts - Create a new
messages/<locale>/directory with the same JSON files (system.json, navbar.json, dashboard.json, auth.json) - Translate the keys used by auth, dashboard, and marketing sections
- Verify locale switching and route generation in the UI
Practical guidance
Keep config-driven labels synchronized with translation keys. This is especially important for:
- dashboard section labels
- pricing content
- footer links
- testimonials and FAQ content
Translation consistency
Locale support is only complete when config-driven content and route rendering both stay in sync across every supported language.