Documentation Index Fetch the complete documentation index at: https://glotctl.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Glot is configured using a .glotrc.json file in your project root.
Creating Configuration
Run the init command to create a default configuration:
bash npx glot init
bash pnpm exec glot init
bash yarn glot init
bash bunx glot init
Or create .glotrc.json manually.
Quick Reference
Option Type Default Description primaryLocale string"en"Primary locale for missing key detection messagesRoot string"./messages"Path to locale JSON files sourceRoot string"./"Source code root directory includes string[]See below Directories to scan for TSX/JSX ignores string[][]Paths or glob patterns to exclude ignoreTestFiles booleantrueSkip test files automatically ignoreTexts string[][]Text patterns to ignore checkedAttributes string[]See below JSX attributes to check
Configuration Details
primaryLocale The primary locale for your application. Missing key detection uses this locale as the source of truth. {
"primaryLocale" : "en"
}
messagesRoot Path to the directory containing your locale JSON files. Type Default string"./messages"
{
"messagesRoot" : "./messages"
}
Expected structure: messages/
├── en.json
├── es.json
├── fr.json
└── ...
For backward compatibility, messagesDir is also accepted as an alias.
sourceRoot The root directory for source code scanning. Paths in includes are relative to this directory. {
"sourceRoot" : "./src"
}
This is useful when your source code is in a subdirectory or when working in a monorepo.
includes Directories to scan for TSX/JSX files. Glot only checks files in these directories. Type Default string[]See below
Default value: {
"includes" : [
"src/app/[locale]" ,
"src/components" ,
"app/[locale]" ,
"components"
]
}
Glot supports two types of include patterns: Directory paths (without * or ?):Scans all files within the specified directory. {
"includes" : [ "src/app/[locale]" , "src/components" ]
}
Glob patterns (with * or ?):Uses glob matching to find directories to scan. {
"includes" : [ "src/*" , "packages/*/src" ]
}
Paths can include Next.js dynamic route syntax like [locale]. This is
treated as a literal folder name, not a glob pattern.
ignores Paths or glob patterns to exclude from scanning. Glot supports two types of ignore patterns: Directory paths (without * or ?):Excludes the entire directory and all files within it. This works the same way as includes. {
"ignores" : [ "src/components/ai-elements" , "src/generated" ]
}
Glob patterns (with * or ?):Uses glob matching for more flexible patterns. {
"ignores" : [ "**/*.stories.tsx" , "**/mocks/**" ]
}
Mixed usage: You can combine both directory paths and glob patterns: {
"ignores" : [
"src/components/ai-elements" ,
"src/generated" ,
"**/*.stories.tsx" ,
"**/node_modules/**"
]
}
Directory paths like src/components/ai-elements will exclude all files under
that directory. Paths can include Next.js dynamic route syntax like
app/[locale]/admin - the [locale] is treated as a literal folder name.
ignoreTestFiles Skip test files automatically. When enabled, glot ignores:
*.test.tsx, *.test.ts, *.test.jsx, *.test.js
*.spec.tsx, *.spec.ts, *.spec.jsx, *.spec.js
Files in __tests__/ directories
{
"ignoreTestFiles" : true
}
ignoreTexts Specific text patterns to ignore. Case-sensitive. {
"ignoreTexts" : [ "TODO" , "FIXME" , "Lorem ipsum" ]
}
Useful for:
Development placeholders
Known patterns that don’t need translation
Third-party component text
checkedAttributes JSX attributes to check for hardcoded text . These attributes commonly contain user-facing strings that should be translated. Type Default string[]See below
Default value: {
"checkedAttributes" : [
"placeholder" ,
"title" ,
"alt" ,
"aria-label" ,
"aria-description" ,
"aria-placeholder" ,
"aria-roledescription" ,
"aria-valuetext"
]
}
Setting this option overrides the defaults. Include all attributes you
want checked.
Full Example
A complete configuration file:
{
"primaryLocale" : "en" ,
"messagesRoot" : "./locales" ,
"sourceRoot" : "./" ,
"includes" : [ "src/app/[locale]" , "src/components" , "src/features" ],
"ignores" : [ "**/node_modules/**" , "**/*.stories.tsx" , "**/mocks/**" ],
"ignoreTestFiles" : true ,
"ignoreTexts" : [ "TODO" , "FIXME" , "N/A" ],
"checkedAttributes" : [ "placeholder" , "title" , "alt" , "aria-label" ]
}
Configuration Resolution
Glot searches for .glotrc.json starting from the specified path (or current directory) and traversing upward:
Check current directory for .glotrc.json
If not found, check parent directory
Continue until:
A .glotrc.json is found
A .git directory is encountered (project root)
Filesystem root is reached
If no configuration is found, glot uses all default values.
Validation
Glot validates your configuration on startup:
Paths in includes are checked for existence
Glob patterns in ignores are validated
Invalid configuration shows clear error messages
Error: Invalid configuration in .glotrc.json
- includes[0]: Directory "src/pages" does not exist
- ignores[2]: Invalid glob pattern "***"
Common Configurations
{
"primaryLocale" : "en" ,
"messagesRoot" : "./messages" ,
"includes" : [
"src/app/[locale]" ,
"src/components"
]
}
{
"primaryLocale" : "en" ,
"messagesRoot" : "./locales" ,
"includes" : [
"src/pages" ,
"src/components"
]
}
Monorepo with Multiple Apps
{
"primaryLocale" : "en" ,
"messagesRoot" : "./packages/i18n/messages" ,
"includes" : [
"apps/web/src/app/[locale]" ,
"apps/web/src/components" ,
"packages/ui/src"
]
}
Init Command Create configuration file
Directives Inline suppression directives