Frameworks

Generic

The generic adapter runs any project whose locale files you can name: Svelte, Astro, Rails, 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 nothing — and those exact paths are used, resolved against the project directory. A path that does not exist is an error naming it. This is not a fallback the other adapters fall through to: declaring both keys on a Next.js or Vue project takes the project away from that framework's adapter, see Detection.

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:

i18n-kit.config.ts
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 wantHow
A fixed locale list instead of discoverylocales
Pin the adapter, so a later dependency change cannot move the projectframework: 'generic'
Authoring context for translationcontext, 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 localeFileFormat is honored by the Laravel adapter, not this one.
  • Locale codes are unioned across directories. A directory holding a deliberate subset needs locales declared, 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.
Copyright © 2026