Keyglot without a framework
The Keyglot runtime ships as a zero-dependency core package with optional React bindings.
In plain JavaScript the same pieces apply: the CLI keeps your repository's translation
files correct, and the core client delivers published translations straight from the
Keyglot CDN with caching, staleness handling, and locale-aware t() built in.
1. Track source text with the CLI
The scanner works on JavaScript and TypeScript of any flavor — no framework adapter
required to get value out of scan, check, and extract:
The i18next adapter is the closest match for plain JavaScript apps: extraction emits
t('key', { ns }) calls, and check understands them when it computes missing and
unused keys.
keyglot.config.jsonc controls everything: which files are scanned (include), where
resources live (sink.resourcePattern), and how keys are shaped (keyStyle nested or
flat). Every command locates the nearest enclosing configuration automatically, so it
works from any directory in a monorepo, and check run from a configuration-less repo
root checks every configured child package and aggregates the results.
2. Push to the cloud and publish
Publications are immutable: once promoted, a version serves until you promote the next one,
and rollback is instant. keyglot pull --environment production can reproduce the exact
published files at any time.
3. Deliver translations with the core client
Install the core package and create a client pointed at your project's delivery endpoint:
The client API is small on purpose:
load()/loadNamespace(ns)fetch published resources once and cache them.t(namespace, key, options)interpolates{{placeholders}}and resolves plurals fromcountusingIntl.PluralRules, so_one/_otherfamilies work in every locale without extra libraries.setLocale(locale)swaps languages at runtime and re-resolves namespaces.subscribe(listener)reports snapshot changes (ready, loading, stale, error) if you build your own binding layer.fallbackResourcesinlines a bundled copy of the last known good translations so a cold CDN miss never shows raw keys.
Publishable keys (kg_pub_...) are project-scoped browser credentials: safe to ship in a
client bundle, revocable from the dashboard, and enforced with per-plan request budgets on
the CDN.
4. Keep it healthy in CI
The report flags hardcoded text, missing keys, unused keys, missing translations,
placeholder mismatches, plural families without _other, and drift between your local
resources and the active production publication. Configure what fails in the check
section of keyglot.config.jsonc or with flags:
Key conventions
- Interpolations are
{{name}}; plural categories are_zero,_one,_two,_few,_many,_other, with_otherrequired. - Resource shape follows your configured pattern and key style;
pull,push, anddiffall accept--resource-patternand--key-styleoverrides. - The CLI never mutates anything without
--write, andpushnever archives cloud-only keys.