Bucket defines a group of source files that share the same translation output location and format. Each bucket specifies which files to scan for translatable strings and where to write the resulting translation files.
Properties
Array of glob patterns to match source files. Uses picomatch for pattern matching.Common patterns:
src/**/*.ts- All TypeScript files in src directory**/*.{js,jsx}- All JavaScript and JSX filescomponents/**/*- All files in components directory
Array of glob patterns to exclude from matching. Also uses picomatch.Useful for excluding:
- Test files:
**/*.test.ts,**/*.spec.js - Generated files:
**/*.generated.ts - Dependencies:
**/node_modules/**
Template string defining where translation files are written. Must contain both Other valid patterns:
{locale} and .{extension} placeholders.Template format:{locale}- Replaced with the locale code (e.g.,en,fr,ja).{extension}- Replaced with the formatter’s extension (e.g.,.po,.json)
Custom formatter for parsing and generating translation files. Defaults to
@saykit/format-po if not specified.See Formatter for details on implementing custom formatters.Examples
Basic Configuration
saykit.config.ts
Multiple Buckets
Separate frontend and backend translations:saykit.config.ts
With Exclusions
saykit.config.ts
JSON Configuration
Buckets can also be defined insaykit.config.json:
saykit.config.json
Pattern Matching
Buckets use picomatch for glob pattern matching. The matcher is created internally:Type Definition
From@saykit/config/src/shapes.ts:39: