translate-kit

init

Interactive setup wizard.

The init command runs an interactive wizard to set up translate-kit in your project.

Usage

translate-kit init

What It Does

The wizard guides you through:

  1. Translation mode — keys mode (t("key")) or inline mode (<T id="key">text</T>)
  2. AI provider selection — choose from OpenAI, Anthropic, Google, Mistral, or Groq
  3. Model name — pick a specific model (e.g. gpt-4o-mini)
  4. Source locale — your source language (default: en)
  5. Target locales — languages to translate into
  6. Messages directory — where translation files live (default: ./messages)
  7. Include patterns — which source files to scan (auto-detected)
  8. i18n library — the import source for useTranslations (keys mode only)
  9. Component path — import path for the <T> component (inline mode only)
  10. Project context — description for better translations
  11. Tone — translation style (professional, casual, etc.)

Generated Files

The wizard creates:

  • translate-kit.config.ts — your configuration file

Keys mode

For next-intl projects, it can also create:

  • i18n/request.ts — locale detection setup
  • Updates to next.config.ts with createNextIntlPlugin

Inline mode

For inline mode, the wizard also:

  • Copies t.tsx (client component) and t-server.tsx (server component) to your project
  • Creates src/i18n/index.ts with getLocale() and getMessages() helpers
  • Wraps your root layout with I18nProvider and wires up locale detection

Full Pipeline

At the end, the wizard offers to run the full pipeline:

scan → codegen → translate

This scans your source code, replaces strings with t() calls, and generates translations in one step.