Works with the i18next you already have
If your app calls i18next.t() directly — Vue, Svelte, Node, plain DOM scripts, or any
setup where useTranslation is not in play — the i18next adapter fits. The CLI scans your
source, finds hardcoded strings, extracts them into resources your existing i18next instance
can load, and syncs everything with the Keyglot cloud.
1. Initialize
This writes keyglot.config.jsonc and a starter resource at
src/locales/en/common.json. Adjust include and resourcePattern to match your project:
2. Extract hardcoded text
For the i18next adapter, the transform emits instance calls with an explicit namespace:
Interpolations are preserved:
Nothing is written without --write, and --candidate ID applies single findings.
3. Load the resources
Wire the generated files into your i18next initialization exactly as you already do:
keyglot pull writes one file per {locale}/{namespace} pair from the cloud working
copy, so the shape never drifts from what the extractor writes.
4. Sync with the Keyglot cloud
push batches changes, threads revision guards so concurrent edits surface as errors
instead of silent overwrites, and never archives cloud-only keys.
5. Health check and CI
The scanner resolves i18next.t('key', { ns: 'ns' }) calls (including default and namespace
imports of i18next) to tell you which referenced keys are missing from the source locale,
which resource keys are unused, which translations are incomplete, where placeholder sets
disagree, where plural families lost their _other fallback, and how far your local files
have drifted from the active production publication.
In CI, tighten the failure surface:
Per-category budgets and the default failing categories are configurable in the check
section of keyglot.config.jsonc:
Key conventions
- Namespaces resolve from the
{ ns }call option or the default namespace; thens:keyprefix is honored the same way. - Interpolations use
{{name}}placeholders and are checked for consistency across locales. - Plurals use
_zero,_one,_two,_few,_many,_othersuffixes with_otherrequired as the fallback. - Key style can be
nestedorflat; pass--key-styleto pull, push, and diff to override the configured default.