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 exposed through
appConfig.i18ninapp.config.ts. The shared locale values are defined in the siblingapp.i18n.json, which is also consumed by the Next.js andnext-i18nextconfiguration. redirectsandrewritesmethods are defined innext.config.ts. They return arrays generated bycreateRewritesAndRedirectsfrom the route translations inapps/foundation/src/app.i18n.json.
See NextJS docs for more detail on rewrites.