Skip to main content
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

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