NextReady includes a complete internationalization (i18n) system powered by next-intl, supporting multiple languages out of the box.
NextReady uses next-intl to provide a comprehensive internationalization solution for your SaaS application. The system is built to support multiple languages with minimal configuration, allowing you to reach a global audience.
NextReady supports the following languages out of the box:
Language | Locale Code | URL Path |
---|---|---|
English | en | /en/... |
French | fr | /fr/... |
Spanish | es | /es/... |
German | de | /de/... |
You can easily add more languages by updating the configuration files in src/i18n.ts
and adding translation files for the new language.
NextReady uses Next.js App Router with internationalized routing based on URL subpaths.
The routing configuration is set up in the middleware.ts file to handle locale detection and routing.
The app directory structure follows the Next.js App Router conventions with the locale parameter:
Each page component receives the locale parameter from the URL structure.
Translations are stored in JSON files organized by language and namespace.
Translation files are located in the messages
directory, with one file per supported language.
Each translation file contains namespaced translations for different parts of your application.
NextReady provides components and hooks to use translations in your application.
For server components, use the getTranslations
function from next-intl/server.
For client components, use the useTranslations
hook from next-intl.
NextReady provides utilities for formatting dates, times, and numbers according to the user's locale.
Use the useFormatter
hook to format dates and times according to the current locale.
Use the useFormatter
hook to format numbers, currencies, and percentages according to the current locale.
NextReady includes a language switcher component that allows users to change the language of the application.
The language switcher component is implemented in src/components/LanguageSwitcher.tsx
.
Add the language switcher to your layout or navigation component for easy language switching.
NextReady is configured for optimal SEO with internationalized content.
The html
element's lang
attribute is automatically set based on the current locale.
Alternate language links are added in the document head for better SEO.
Metadata for each page is translated based on the current locale.
Now that you understand how internationalization works in NextReady, you might want to explore: