Skip to content

The most natural-sounding way to translate your Next.js apps

Notifications You must be signed in to change notification settings

devgioele/next-fluent

Repository files navigation

next-fluent

The most natural-sounding way to translate your Next.js apps.

Like next-i18next, but using Fluent, the successor of i18next.

WIP 🚧

This is a WIP and there are currently two main obstacles that I don't know how to solve:

  • The first load JS is about 175 kB, which is unacceptably big
  • The SSG example does not work

Setup

Coming soon...

Caveats

There are some non-obvious prohibited usages due to current limitations of @fluent/react. When using the elems attribute of the Localized element, thus using the React overlays mechanism, pay attention to the following:

  • Localized must have one child element
  • The identifiers used in the elems record cannot be numbers or HTML elements

How it works

Makes a bridge between @fluent/react and Next.js using internationalized routing.

Uses cheerio for the SSR of localized components using React Overlays.