Skip to main content
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
Or create .glotrc.json manually.

Quick Reference

Configuration Details

primaryLocale

primaryLocale

The primary locale for your application. Missing key detection uses this locale as the source of truth.

messagesRoot

Path to the directory containing your locale JSON files.
Expected structure:
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.
This is useful when your source code is in a subdirectory or when working in a monorepo.

includes

Directories to scan for source files. Glot only checks .tsx, .jsx, .ts, .js, and supported .astro files in these directories.Default value:
Glot supports two types of include patterns:Directory paths (without * or ?):Scans all files within the specified directory.
Glob patterns (with * or ?):Uses glob matching to find directories to scan.
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.
Glob patterns (with * or ?):Uses glob matching for more flexible patterns.
Mixed usage:You can combine both directory paths and glob patterns:
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

ignoreTexts

Specific text patterns to ignore. Case-sensitive.
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.Default value:
Setting this option overrides the defaults. Include all attributes you want checked.

severities

Override the effective severity for specific rules.
Supported severity values are "error" and "warning".Supported rule keys:
  • hardcoded
  • missing or missing-key
  • replica-lag
  • untranslated
  • type-mismatch
  • unused or unused-key
  • orphan or orphan-key
  • unresolved or unresolved-key
untranslated is an error by default when the key is used in source, and a warning when no source usage is found. If your project intentionally keeps some used values identical across locales, prefer targeted glot-disable-next-line untranslated comments. Use severities when you want a project-wide policy change.
parse-error cannot be configured. Parse errors always return exit code 2.

extraTranslationCallees

Additional bare callee names to treat as translation usage.
Use this for project-specific wrappers when the call itself is the translation API. Entries are matched by callee name, so keep the list narrow.

extraTranslationMemberCalls

Additional constrained member-call patterns to treat as translation usage.Each entry supports these fields:
  • property (required): member name such as translate
  • objectName (optional): local object name such as intl
  • importFrom (optional): restrict to a specific import source
  • importName (optional): restrict to a specific imported binding such as default, *, or a named export
At least one of objectName or importFrom is required.
This option is intentionally constrained. It is for known project APIs, not for treating every .t(...) call as a translation usage.

Full Example

A complete configuration file:
.glotrc.json

Configuration Resolution

Glot searches for .glotrc.json starting from the specified path (or current directory) and traversing upward:
  1. Check current directory for .glotrc.json
  2. If not found, check parent directory
  3. 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

Common Configurations

Init Command

Create configuration file

Directives

Inline suppression directives