How it works
The internationalization system is built on Next.js Internationalization’s routing system and Languine’s translation system. It’s configured by default for theweb
package to:
- Detect the user’s preferred language through browser headers
- Route users to language-specific paths (e.g.,
/en/about
,/fr/about
) - Serve content from language-specific dictionaries
Setup
Set Languine environment variable
To enable automatic translations, simply create a.env
file in the internationalization
package and set the LANGUINE_PROJECT_ID
environment variable.
.env
Login languine
Terminal
Languine offers 500 translation keys for free. If you need more, you need upgrade to a paid plan.If you don’t want to use Languine, you can manually translate your content. You do not need to set the
LANGUINE_PROJECT_ID
environment variable in this case.Configuration
The internationalization package is configured through alanguine.json
file that defines:
- Source locale (e.g.,
en
) - Target locales (e.g.,
["es", "de"]
) - Dictionary file locations
Dictionary Structure
Dictionaries are TypeScript files that export strongly-typed content for each supported language. The type system ensures consistency across translations:packages/internationalization/dictionaries/[locale].ts
Usage
Translating
To translate your application, you can run the following command:Terminal
dictionaries
folder.
Frontend
To use the internationalization package, you need to:- Maintain a dictionary for your source locale.
- Import the dictionary into your application.
- Use the dictionary to render content.
web
package:
apps/web/app/page.tsx
locale
parameter in the URL. For example, https://example.com/en/about
will render the about
page in English.
We’ve already configured the web
package with a language switcher, so you don’t need to worry about it.

Middleware
The internationalization package also includes a middleware component that automatically detects the user’s language and routes them to the appropriate language-specific page. This has already been configured for theweb
package, so you don’t need to worry about it.
apps/web/middleware.ts