Skip to main content

Overview

Here we will talk about the i18n features and capabilities of Blueprint.

next-i18next package​

We use the next-i18next package to provide content translations for static content for the Foundation app.

Translation files can be stored in a shared package or within each app's directory, as documented here. The Foundation app follows the standard approach of storing translations within the app.

Route translations​

We handle translating app routes with NextJS's built-in internationalization routing capabilities as well as some custom code. There are a number of touch-points for this:

  • Supported locales are configured in the i18n config object in the app's next.config.js file.
  • a redirects array and a rewrites method are also provided to the next.config.js object. These arrays are generated using createRewritesAndRedirects based on the translations provided in the app (e.g. apps/foundation/src/app.i18n.cjs), which is where we provide translations for parts of URLs and the supported locales.

See NextJS docs for more detail on rewrites.