Skip to content

createI18nMiddleware

createI18nMiddleware is a middleware helper for React Bricks projects with localized routes.

Use it in:

  • Next.js App projects
  • Astro projects

It makes i18n routing easier to manage by centralizing locale resolution in middleware.

Use createI18nMiddleware when your project has localized content and needs routing middleware to resolve the correct language before rendering.

If the same project also uses A/B Testing in Next.js App, use createWithAbTestingMiddleware to chain i18n and A/B Testing concerns.