Migration from v15
What changes when you move from next-i18next 15 to 16, for App Router and Pages Router apps.
App Router users
If you were using i18next and react-i18next directly (as recommended in v15):
npm install next-i18next@16- Create an
i18n.config.tswith your languages and namespaces - Replace your custom proxy/middleware with
createProxy(config)inproxy.ts - Replace your custom
getT/ translation init with a server module:createServerI18next(config)and thegetTit returns - Replace your custom
I18nProviderwith the one fromnext-i18next/client - Replace
useTranslationwithuseTfromnext-i18next/clientin client components
Pages Router users
- Update imports from
next-i18nexttonext-i18next/pages - Update
serverSideTranslationsimport tonext-i18next/pages/serverSideTranslations - Update type imports:
import type { TFunction, WithTranslation, I18n } from 'next-i18next/pages' - Everything else works the same