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 our apps.

We store the translations in the core package so that we can use them in multiple applications. This can be removed if it doesn't suit your app structure, and the locales would usually live in the directory of the app which uses them, as documented here.

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 apps/<app-name>/src/app.constants.js, which is where we provide translations for parts of urls, and the supported locales.

See NextJS docs for more detail on rewrites.

Content management and i18n

We provide translations for content managed pages via Storyblok.