# How to internationalize your Next.js application using next-i18next in 2025 ## What is next-i18next? **next-i18next** is a popular internationalization (i18n) solution for Next.js applications. While the original `next-i18next` package was designed for the Pages Router, this guide shows you how to implement i18next with the modern **App Router** using `i18next` and `react-i18next` directly. With this approach, you can: - **Organize translations** using namespaces (e.g., `common.json`, `about.json`) for better content management. - **Load translations efficiently** by loading only the namespaces needed for each page, reducing bundle size. - **Support both server and client components** with proper SSR and hydration handling. - **Ensure TypeScript support** with type-safe locale configuration and translation keys. - **Optimize for SEO** with proper metadata, sitemap, and robots.txt internationalization. > As an alternative, you can also refer to the [next-intl guide](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/i18n_using_next-intl.md), or directly using [Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_16.md). > See the comparison in [next-i18next vs next-intl vs Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/next-i18next_vs_next-intl_vs_intlayer.md). ## Practices you should follow Before we dive into the implementation, here are some practices you should follow: - **Set HTML `lang` and `dir` attributes** In your layout, compute `dir` using `getLocaleDirection(locale)` and set `` for proper accessibility and SEO. - **Split messages by namespace** Organize JSON files per locale and namespace (e.g., `common.json`, `about.json`) to load only what you need. - **Minimize client payload** On pages, send only required namespaces to `NextIntlClientProvider` (e.g., `pick(messages, ['common', 'about'])`). - **Prefer static pages** Use static page as much as possible for better performance and SEO. - **I18n in server components** Server components, like pages or all components not marked as `client` are statics and can be pre-rendered at build time. So we will have to pass the translation functions to them as props. - **Set up TypeScript types** For your locales to ensure type safety throughout your application. - **Proxy for redirection** Use a proxy to handle the locale detection and routing and redirect the user to the appropriate locale-prefixed URL. - **Internationalization of your metadata, sitemap, robots.txt** Internationalize your metadata, sitemap, robots.txt using the `generateMetadata` function provided by Next.js to ensure a better discovery by search engines in all locales. - **Localize Links** Localize Links using the `Link` component to redirect the user to the appropriate locale-prefixed URL. It's important to ensure the discovery of your pages in all locales. - **Automate tests and translations** Automate tests and translations help loosing time to maintain your multilingual application. > See our doc listing everything you need to know about internationalization and SEO: [Internationalization (i18n) with next-intl](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/internationalization_and_SEO.md). ## Step-by-Step Guide to Set Up i18next in a Next.js Application