Skip to main content

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 a fast Rust-based CLI tool for checking internationalization (i18n) issues in Next.js projects using next-intl. It helps you catch hardcoded text that should use translation functions, find missing translation keys, and identify unused translations.

Key Features

Hardcoded Text Detection

Find untranslated text in JSX/TSX files that should use i18n translation functions

Missing Key Detection

Identify translation keys used in code but missing from your locale files

Unused Key Detection

Find translation keys defined in primary locale but never used in code

Orphan Key Detection

Find keys in non-primary locales that don’t exist in primary locale

Replica Lag Detection

Find keys in primary locale missing from other locales

Untranslated Detection

Detect values identical to primary locale that may need translation

Type Mismatch Detection

Detect type conflicts between locales (string vs array) that cause runtime errors

Unresolved Key Detection

Find dynamic keys that cannot be statically analyzed

Multi-language Support

Detects text in any language using Unicode alphabetic character detection

AI Integration

MCP server for AI agents like Claude to analyze and fix i18n issues

Scope

Glot is designed specifically for Next.js projects using next-intl as the i18n library. It is not a general-purpose i18n linter. Supported:
  • Next.js App Router and Pages Router
  • next-intl’s useTranslations, getTranslations, t(), t.rich(), t.raw(), t.markup()
  • TSX/JSX files with .tsx, .jsx, .ts, .js extensions
  • JSON-based locale files
Not supported:
  • Other frameworks (Vue, Angular, Svelte, etc.)
  • Other i18n libraries (react-intl, i18next, lingui, etc.)
  • Non-JSON translation formats (YAML, PO, XLIFF, etc.)
If your project doesn’t use next-intl, glot’s hardcoded text detection still works — but translation key analysis (missing, unused, orphan, etc.) requires next-intl patterns.

Why Glot?

  • Fast: Built in Rust using the same parser as Next.js (swc)
  • Accurate: Understands JSX/TSX syntax and next-intl patterns
  • Configurable: Customize detection rules, ignored patterns, and checked attributes
  • CI-friendly: Perfect for automated pipelines with exit codes and structured output

How It Works

Glot parses your TSX/JSX files using the swc AST parser (the same parser used by Next.js) and performs static analysis to detect hardcoded text, track translation function usage, and resolve dynamic keys. For a detailed breakdown of all supported patterns, detection capabilities, and known limitations, see How Detection Works.

Installation

npm install -D glotctl
The npm package is glotctl, but the CLI command is glot.

Quick Example

# Check your project for i18n issues
npx glot check

# Output:
# error: "Submit"  hardcoded-text
#   --> ./src/components/Button.tsx:5:22
#   |
# 5 |     return <button>Submit</button>;
#   |                    ^
#
# ✘ 1 problem (1 error, 0 warnings)

Next Steps

Quick Start

Install glot and run your first i18n check in 2 minutes