SSR (additional components)

Using Next.jsarrow-up-right App Router?

Then check out this articlearrow-up-right describing how to best internationalize it with i18next.

arrow-up-right

You should have a look at next-i18nextarrow-up-right which extends react-i18next to bring it to next.js the easiest way.

With [email protected] and Next.js v10, next-i18next has done a major rewrite of the package, leveraging the built-in internationalized routingarrow-up-right provided by Next.js.

Herearrow-up-right you can also find a next-i18next app example in combination with locize, that offers 2 different approaches.

[email protected] supports Next.js v9.5 in Serverless modearrow-up-right (as of July 2020arrow-up-right). If your goal is to use earlier versions of Next.js with Serverless, then you should have a look at "Next Right Now"arrow-up-right, which is a Next.js 9 boilerplate with built-in i18next, react-i18next and Locize.

Looking for an optimized Next.js translations setup? Herearrow-up-right you'll find a blog post on how to best use next-i18next with client side translation download and SEO optimization.

arrow-up-right


Using SSG / next export? Herearrow-up-right you'll find a simple tutorial on how to best use next-i18next in a SSG environment. arrow-up-right

You should have a look at remix-i18nextarrow-up-right which extends react-i18next to bring it to Remix the easiest way.

Herearrow-up-right you'll find a simple example and here a step by step tutorialarrow-up-right on how to best use remix-i18next.

arrow-up-right

You should have a look at gatsby-plugin-react-i18nextarrow-up-right which extends react-i18next to bring it to Gatsby the easiest way.

Herearrow-up-right you'll find a simple example and here a step by step tutorialarrow-up-right on how to best use gatsby-plugin-react-i18nextarrow-up-right.

arrow-up-right

Setting the i18next instance based on req

Use the I18nextProvider to inject the i18next instance for example bound to the http i18n instance on the request object using i18next-http-middlewarearrow-up-right.

Passing initial translations / initial language down to client

To avoid asynchronous loading of translation on the client side (and the possible Suspense out of that) you will need to pass down initialLanguage (will call changeLanguage on i18next) and initialI18nStore (will prefill translations in i18next store).

using the useSSR hook

using the withSSR HOC

The ExtendedApp in this case will also have the composed ExtendedApp.getInitialProps()

Last updated