i18nexus / next-i18n-router

Next.js App Router internationalized routing and locale detection.
MIT License
245 stars 16 forks source link

Trans component serverside? #89

Closed RebeccaStevens closed 1 month ago

RebeccaStevens commented 1 month ago

Is it possible to use the Trans component from react-i18next for server-side translations?

import { I18nextProvider, Trans } from "react-i18next";

// ...

<Trans
  i18nKey="myKey"
  components={{ italic: <i />, bold: <strong /> }}
/>

It currently throws with:

 ⨯ TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
i18nexus commented 1 month ago

This seems to be the proper way to go about it: https://stackoverflow.com/a/78273131