npm next-i18next 16.4.0
v16.4.0

2 hours ago
  • App Router: ICU and MF2 without a 'use client' wrapper - next-i18next/icu and next-i18next/mf2 export an I18nProvider with the same props as the one from next-i18next/client, with i18next-icu or i18next-mf2 registered on the client instance. Render it from the root layout and keep use: [ICU] (or [MF2]) in the server config. A Server Component can not pass a plugin class to a Client Component, so <I18nProvider use={[ICU]}> in a layout failed the build with "Functions cannot be passed directly to Client Components", and ICU needed a hand-written 'use client' wrapper around the provider. Both plugins are optional peer dependencies: apps that never import these entry points do not resolve or bundle them. New README section "ICU and MF2 with the App Router" (setup, getT/useT, rich text with IcuTransWithoutContext from react-i18next 17.0.21 in Server Components, parseInterpolation: false for TypeScript, extract.messageFormat in i18next-cli 1.76.0) and a new example, app-router-icu.

Don't miss a new next-i18next release

NewReleases is sending notifications on new releases.