primaryLocale
The primary locale for your application. Missing key detection uses this locale as the source of truth.| Type | Default |
|---|---|
string | "en" |
Complete .glotrc.json configuration reference
.glotrc.json file in your project root.
bash npx glot init .glotrc.json manually.
| Option | Type | Default | Description |
|---|---|---|---|
| primaryLocale | string | "en" | Primary locale for missing key detection |
| messagesDir | string | "./messages" | Path to locale JSON files |
| includes | string[] | See below | Directories to scan for TSX/JSX |
| ignores | string[] | [] | Paths or glob patterns to exclude |
| ignoreTestFiles | boolean | true | Skip test files automatically |
| ignoreTexts | string[] | [] | Text patterns to ignore |
| checkedAttributes | string[] | See below | JSX attributes to check |
primaryLocale
| Type | Default |
|---|---|
string | "en" |
messagesDir
| Type | Default |
|---|---|
string | "./messages" |
includes
| Type | Default |
|---|---|
string[] | See below |
* or ?):Scans all files within the specified directory.* or ?):Uses glob matching to find directories to scan.[locale]. This is
treated as a literal folder name, not a glob pattern.ignores
| Type | Default |
|---|---|
string[] | [] |
* or ?):Excludes the entire directory and all files within it. This works the same way as includes.* or ?):Uses glob matching for more flexible patterns.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
| Type | Default |
|---|---|
boolean | true |
*.test.tsx, *.test.ts, *.test.jsx, *.test.js*.spec.tsx, *.spec.ts, *.spec.jsx, *.spec.js__tests__/ directoriesignoreTexts
| Type | Default |
|---|---|
string[] | [] |
checkedAttributes
| Type | Default |
|---|---|
string[] | See below |
.glotrc.json starting from the specified path (or current directory) and traversing upward:
.glotrc.json.glotrc.json is found.git directory is encountered (project root)includes are checked for existenceignores are validatedNext.js App Router
Next.js Pages Router
Monorepo with Multiple Apps