Project

i18n-collector

Manage and compile locale files — split translations by feature, merge into one file per language

i18n-collector

i18n-collector collects scattered locale files across your codebase and compiles them into one JSON per language — automatically, with watch mode for development.

One feature, one file

Keep translations next to the component they belong to. Instead of a monolithic en.json with hundreds of keys, each feature owns its own .locale.json — easier to find, easier to review, easier to delete when the feature goes away.

One file per language

At build time, i18n-collector merges everything into a single en.json, de.json, and so on — ready for i18next or any i18n library. Your app imports one file per locale; the tool handles the rest.

Watch mode

During development, run the collector in watch mode. Edit a translation file, save, and compiled locales update in milliseconds — no manual merge step, no stale keys lingering in output.

No duplicate keys

Splitting translations across files raises the risk of collisions. The collector validates uniqueness as it compiles, so overlapping keys surface immediately instead of silently overwriting each other in production.

Works with your stack

i18n-collector is not a replacement for i18next, react-i18next, or any other i18n framework — it sits upstream. You write small locale files in source; the tool produces the bundles your library already expects.

Architecture

i18n-collector scans your source tree for locale files, validates and merges them by language, and writes compiled JSON to an output directory. A CLI for local development and CI, a JavaScript API for custom pipelines — same logic, two entry points.

Why I built it

Large apps with many languages tend toward giant translation files that nobody wants to touch. I wanted colocation — translations living beside components — without sacrificing the simplicity of one import per locale at runtime.

Get started with i18n-collector →