Setting up your next.js project

First, visit the next.js website to setup your project, scroll down to the setup section. If you have installed node, you should be able to execute the command below immediately as described on the next.js website.

npm init next-app

Installing next-i18next and its dependencies

You may have to install several dependencies:

  • express
  • i18next
  • next-i18next

Integrating next-i18next

Make sure you have the necessary dependencies as shown below with the correct scripts configured in ‘packages.json’.

https://gist.github.com/jonashendrickx/c37e4d3ff1b411e4318ad66f7e357313#file-packages-json

You can modify any settings for next-i18next in your ‘next.config.js’. Make sure you define and export it as shown below.

https://gist.github.com/jonashendrickx/c37e4d3ff1b411e4318ad66f7e357313#file-next-config-js