Generic
The generic adapter runs any project whose locale files you can name: Svelte, Astro, Rails, Vue, a design system package, a monorepo of shared catalogs, or a framework the kit has never heard of. Declare both localeDirs and defaultLocale in your kit config — one key without the other does not activate it — and those exact paths are used, resolved against the project directory. A path that does not exist is an error naming it. Declaring both keys on a Next.js project takes the project away from that framework's adapter, see Detection.
Declare neither and a project with no framework signals still resolves from locales, src/locales, i18n/locales, src/i18n/locales or src/i18n — the first one holding locale files, as a single layer named default, with the first locale code in sorted order as the default locale.
A layer is a scoped locale directory — a Nuxt layer, a workspace package, a shared UI library, or one app in a monorepo. You get one per entry, and this is the one adapter where you name them yourself:
import { defineI18nKitConfig } from '@the-i18n-kit/cli/config'
export default defineI18nKitConfig({
defaultLocale: 'en',
localeDirs: [
'apps/web/locales',
{ path: 'packages/ui/locales', layer: 'ui' },
{ path: 'packages/emails/locales', layer: 'emails' },
],
})
Those names are what --layer accepts and what per-layer reports are keyed by, so choose them deliberately. A plain string entry is named default. The same shape works in .i18n-mcp.json.
Overrides
Beyond the two required keys:
| What you want | How |
|---|---|
| A fixed locale list instead of discovery | locales |
| Layer names, or more than one directory | localeDirs — probing finds one directory, never several |
| Pin the adapter, so a later dependency change cannot move the project | framework: 'generic' |
| Authoring context for translation | context, glossary, localeNotes, translationPrompt |
Limits
- The file format is inferred from the first locale directory only. A set of directories in mixed formats resolves as whatever the first one looks like, and
localeFileFormatis honored by the Laravel adapter, not this one. - YAML locale files are read and written,
.yamland.ymlalike — flat (en.yaml,de-DE.yml) or a directory per locale. A directory mixing formats resolves to whichever has the most files and warns, and comments do not survive a write: files are re-serialized from their values, so keep notes for translators inlocaleNotesrather than in the locale files. - Locale codes are unioned across directories. A directory holding a deliberate subset needs
localesdeclared, or its absent codes are reported as missing. - Paths resolve against the project directory. Commit relative paths; an absolute path in a committed config works for its author only.