Core Concepts
Configuration
Configure SayKit's extraction, compilation, and locale management
SayKit uses a saykit.config.ts file to define your internationalisation setup. This configuration controls message extraction, locale management, and output formatting.
Configuration File
Create a saykit.config.ts in your project root:
import { defineConfig } from '@saykit/config';
import createFormatter from '@saykit/format-po';
export default defineConfig({
sourceLocale: 'en',
locales: ['en', 'fr', 'es'],
buckets: [
{
include: ['src/**/*.{ts,tsx}'],
output: 'src/locales/{locale}.{extension}',
formatter: createFormatter(),
},
],
});Configuration Type
Configuration
The configuration is type-checked using Zod schemas at runtime:
Prop
Type
Bucket
Buckets group related messages and control extraction and output:
Prop
Type
Formatter
Formatters control how messages are serialized to disk:
Prop
Type
Message
Messages follow this structure during extraction:
Prop
Type