Skip to main content
The check command is the core of glot. It scans your codebase for internationalization issues.
Astro support currently covers translation key usage in supported .astro files (static keys, unresolved dynamic keys, and glot-message-keys declarations). The hardcoded rule does not run on .astro files yet.

Usage

Check Types

You can run specific checks or all checks at once:

Severity

Each check type has a default severity level. Errors cause a non-zero exit code (exit 1). Warnings normally do not, unless you pass --error-on-warnings.
Use --error-on-warnings in CI if your project wants any remaining warning to fail the build. Use severities in .glotrc.json when you want to change a rule’s effective severity for the whole project.

Options

string
Override the source code root directory. Defaults to the value from configuration file.
string
Override the messages directory path. Defaults to the value from configuration file.
string
Override the primary locale. Defaults to the value from configuration file.
boolean
default:"false"
Enable verbose output for debugging.
boolean
default:"false"
Return exit code 1 when any warning is found. This does not rename warnings to errors in the output.

Examples

Basic Check

Check the current directory for all i18n issues:

Override Source Root

Check a specific source directory:

Verbose Mode

Get detailed output including scanned files:

Check Specific Issue Types

Run only hardcoded text detection:
Run hardcoded and missing key checks:

Output Format

Glot displays issues in a compiler-like format:

Issue Severity

Understanding Issues

Each issue type is documented in detail on its own page. Here’s a quick summary:

Quick Fix Guide

Hardcoded text → Replace with t() call, or suppress with glot-disable-next-line. See Hardcoded Text. Missing keys → Add the key to your locale file, or fix typos. See Missing Keys. Type mismatches → Ensure all locales use the same type (string/array/object). See Type Mismatch. Orphan keys → Add to primary locale or remove with glot clean --apply. See Orphan Keys. Unused keys → Remove with glot clean --apply. See Unused Keys. Replica lag → Add missing translations to non-primary locales. See Replica Lag. Untranslated values → Translate the non-primary locale value. If the value is intentionally identical and used in source, suppress it with glot-disable-next-line untranslated. See Untranslated. Unresolved keys → Add glot-message-keys annotations or run glot fix --apply. See Unresolved Keys.

Exit Codes

This makes glot suitable for CI/CD pipelines where you want to fail builds on errors or enforce stricter warning policies.

Verbose Output

With -v flag, glot shows additional information:

CI Examples

Glot works well in CI pipelines. Here are GitHub Actions examples:

Hardcoded Text

Detect untranslated text in JSX/TSX

Missing Keys

Find keys used but not defined

Orphan Keys

Find unused translation keys in non-primary locales

Untranslated Values

Find values that may need translation

Unused Keys

Find keys in primary locale not used in code

Replica Lag

Find keys missing from replica locales

Type Mismatch

Find type conflicts between locales

Unresolved Keys

Find keys that cannot be statically resolved

Directives

Suppress specific warnings