Skip to main content
LazyLocales works seamlessly with i18next and other i18n libraries. The CLI writes translated JSON files directly to your project, which are then bundled or loaded at runtime.

Setup

1

Install dependencies

2

Run LazyLocales translation

Use the CLI to generate translated locale files:
This writes files to your localesDir (e.g., public/locales/):
3

Configure i18next to load local files

Import your locale files directly:
i18n.ts
For dynamic loading with code splitting, use i18next-http-backend pointed at your locale files served from /public/locales/ or your CDN.
4

Use translations in your components

Dynamic loading from public directory

If you prefer to load translations dynamically at runtime, configure i18next-http-backend to fetch from your public directory:
i18n.ts
This loads translations from your public folder (e.g., /public/locales/nl-NL.json), enabling updates without rebuilding your app.

CI/CD integration

Keep translations up to date in your deployment pipeline:
.github/workflows/translate.yml
See the CI/CD guide for complete examples.